Skip to content

Commit 26c735b

Browse files
committed
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.
1 parent 466a04f commit 26c735b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/node/entry.ts

+5-10
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,11 @@ const main = async (args: Args, configArgs: Args): Promise<void> => {
240240
}
241241

242242
async function entry(): Promise<void> {
243-
const tryParse = async (): Promise<[Args, Args, Args]> => {
244-
const cliArgs = parse(process.argv.slice(2))
245-
const configArgs = await readConfigFile(cliArgs.config)
246-
// This prioritizes the flags set in args over the ones in the config file.
247-
let args = Object.assign(configArgs, cliArgs)
248-
args = await setDefaults(args)
249-
return [args, cliArgs, configArgs]
250-
}
251-
252-
const [args, cliArgs, configArgs] = await tryParse()
243+
const cliArgs = parse(process.argv.slice(2))
244+
const configArgs = await readConfigFile(cliArgs.config)
245+
// This prioritizes the flags set in args over the ones in the config file.
246+
let args = Object.assign(configArgs, cliArgs)
247+
args = await setDefaults(args)
253248

254249
// There's no need to check flags like --help or to spawn in an existing
255250
// instance for the child process because these would have already happened in

0 commit comments

Comments
 (0)