Fix writing config error
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-03-15 17:23:14 +01:00
parent 6841a78e8f
commit 836adab5c0
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
2 changed files with 4 additions and 4 deletions

View file

@ -14,6 +14,7 @@ const optionDefinitions = [
name: "verbose",
type: Boolean,
alias: "v",
defaultValue: false,
description: "Print debugging output.",
},
{
@ -59,7 +60,7 @@ if (args.help) {
if (args.verbose) console.log("Running in verbose mode.\n");
if (args.writeConfig) {
writeConfig();
writeConfig(args.verbose);
console.log("Wrote default config file to ./config.jsonc");
exit(0);
}

View file

@ -1,11 +1,10 @@
import { writeFileSync } from "fs";
import args from "./cli.js";
/**
* Writes the sample config file to disk
* @returns Nothing
*/
export default function writeConfig() {
if (args.verbose) console.log("Writing sample config to config.jsonc");
export default function writeConfig(verbose: boolean) {
if (verbose) console.log("Writing sample config to config.jsonc");
writeFileSync(
"./config.jsonc",
// eslint-disable-next-line prettier/prettier