Move cliOptions to helper

This commit is contained in:
Sam Carlton 2022-05-09 16:40:06 -05:00
parent 9ddd105772
commit 20ad66a5de
2 changed files with 12 additions and 6 deletions

View file

@ -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 )

8
helpers/cli-options.js Normal file
View file

@ -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'),
}