From 20ad66a5dec4de9bb596fb5703e8fdbe2816b055 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Mon, 9 May 2022 16:40:06 -0500 Subject: [PATCH] Move cliOptions to helper --- build-lists.js | 10 ++++------ helpers/cli-options.js | 8 ++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 helpers/cli-options.js diff --git a/build-lists.js b/build-lists.js index f68e362..18e6a68 100644 --- a/build-lists.js +++ b/build-lists.js @@ -29,15 +29,13 @@ import { writeStorkToml } from './helpers/stork/toml.js' +import { + cliOptions +} from '~/helpers/cli-options.js' + // Setup dotenv dotenv.config() -const commandArguments = process.argv -const cliOptions = { - withApi: commandArguments.includes('--with-api'), - noLists: commandArguments.includes('--no-lists'), -} - function normalizeVersion ( rawVersion ) { const containsNumbers = /\d+/.test( rawVersion ) diff --git a/helpers/cli-options.js b/helpers/cli-options.js new file mode 100644 index 0000000..5d8db9b --- /dev/null +++ b/helpers/cli-options.js @@ -0,0 +1,8 @@ +export const commandArguments = process.argv +export const cliOptions = { + verbose: commandArguments.includes('--verbose'), + + withApi: commandArguments.includes('--with-api'), + noLists: commandArguments.includes('--no-lists'), + showMerges: commandArguments.includes('--show-merges'), +}