diff --git a/package.json b/package.json index 2775deb..dcc9121 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "postinstall": "node -e \"require('fs').existsSync('githooks') && require('./githooks/configure.js').configure()\"", "buildDebug": "npm run format && npm run fix && tsc --sourceMap true", "build": "npm run format && npm run fix && tsc", - "format": "prettier --write .", + "format": "prettier --loglevel warn --write .", "lint": "eslint . --max-warnings=0 --ignore-pattern dist", "fix": "eslint . --max-warnings=0 --ignore-pattern dist --fix", "start": "node dist/index.js" diff --git a/src/cli/args.ts b/src/cli/args.ts index 51bef61..8093f65 100644 --- a/src/cli/args.ts +++ b/src/cli/args.ts @@ -140,6 +140,19 @@ const parseOptions: ParseOptions = { partial: true }; -const args = parse(optionsDefinition, parseOptions); +const args = ((): CLIArgs & { _unknown: Array } => { + const parsedArgs = parse(optionsDefinition, parseOptions); -export default { _unknown: [], ...args }; + // Adding this here because the CLI integration tests execute API + // methods either from the child process (runCLI) to the parent + // process, the one running mocha, so if we just add --dev in the child + // it fails on the parent process, this is is also fine here because it + // is executed only once at the startup of the program + if (process.env.TEST_DEPLOY_LOCAL === 'true') { + parsedArgs.dev = true; + } + + return { _unknown: [], ...parsedArgs }; +})(); + +export default args;