diff options
Diffstat (limited to 'bullshit.js')
-rw-r--r-- | bullshit.js | 22 |
1 files changed, 22 insertions, 0 deletions
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)) + }) + } + } +} |