From a25d1acd1d702287b6ca095a4079cf3f898cbe89 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 5 Mar 2022 19:18:38 +0100 Subject: Initial commit --- bullshit.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 bullshit.js (limited to 'bullshit.js') diff --git a/bullshit.js b/bullshit.js new file mode 100644 index 0000000..e2aa244 --- /dev/null +++ b/bullshit.js @@ -0,0 +1,22 @@ +const child_process = require("child_process") + +module.exports = { + bullshit: { + help: "Output some random bullshit (ported from the plan9front system)", + func: msg => { + const awk = child_process.spawn("awk", ["-f", "bullshit.awk", "bullshit"]) + let data = "" + + awk.stdout.on("data", chunk => { + data += chunk + }) + + awk.stderr.on("data", console.error) + + awk.on("close", code => { + if (code == 0) + msg.reply(data.slice(0, -2)) + }) + } + } +} -- cgit v1.2.3