From 85385a7eb3a4f7092055b416c4e1aad8cda3a16f Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 30 Nov 2022 13:29:00 -0500 Subject: [PATCH] The create command tests out if you can do options and seems to work just fine. --- commands/create.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 commands/create.js diff --git a/commands/create.js b/commands/create.js new file mode 100644 index 0000000..0d77ebf --- /dev/null +++ b/commands/create.js @@ -0,0 +1,20 @@ +import fs from "fs/promises"; +import { mkdir_to, exec_i } from "../lib/builderator.js"; +import { log } from "../lib/logging.js"; + +export const description = "Test command."; + +export const options = [ + ["--fail", "cause it to fail", false] +]; + + +export const main = async (opts) => { + if(opts.fail) { + log.error("Producing failure."); + process.exit(1); + } else { + log.info("Exiting normally."); + process.exit(0); + } +}