Remove tryParse
Now that the exception handling happens further up there doesn't seem to be an advantage in having this in a separate method.
This commit is contained in:
parent
466a04f874
commit
26c735b434
|
@ -240,16 +240,11 @@ const main = async (args: Args, configArgs: Args): Promise<void> => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function entry(): Promise<void> {
|
async function entry(): Promise<void> {
|
||||||
const tryParse = async (): Promise<[Args, Args, Args]> => {
|
const cliArgs = parse(process.argv.slice(2))
|
||||||
const cliArgs = parse(process.argv.slice(2))
|
const configArgs = await readConfigFile(cliArgs.config)
|
||||||
const configArgs = await readConfigFile(cliArgs.config)
|
// This prioritizes the flags set in args over the ones in the config file.
|
||||||
// This prioritizes the flags set in args over the ones in the config file.
|
let args = Object.assign(configArgs, cliArgs)
|
||||||
let args = Object.assign(configArgs, cliArgs)
|
args = await setDefaults(args)
|
||||||
args = await setDefaults(args)
|
|
||||||
return [args, cliArgs, configArgs]
|
|
||||||
}
|
|
||||||
|
|
||||||
const [args, cliArgs, configArgs] = await tryParse()
|
|
||||||
|
|
||||||
// There's no need to check flags like --help or to spawn in an existing
|
// There's no need to check flags like --help or to spawn in an existing
|
||||||
// instance for the child process because these would have already happened in
|
// instance for the child process because these would have already happened in
|
||||||
|
|
Loading…
Reference in New Issue