Remove unnecessary default accumulator and path check

This commit is contained in:
Chris Wanstrath 2026-03-09 23:56:36 -07:00
parent ff088f1156
commit e554cd36f1

View File

@ -50,7 +50,7 @@ program
.option("-u, --update", "Rewrite expected output in-place with actual output") .option("-u, --update", "Rewrite expected output in-place with actual output")
.option("-k, --keep", "Keep temp directories after run") .option("-k, --keep", "Keep temp directories after run")
.option("--clean-env", "Start with empty environment") .option("--clean-env", "Start with empty environment")
.option("--path <path>", "Prepend <path> to PATH (repeatable)", (val: string, acc: string[]) => [...acc, val], [] as string[]) .option("--path <path>", "Prepend <path> to PATH (repeatable)", (val: string, acc: string[]) => [...acc, val])
.option("--timeout <dur>", "Per-command timeout", "10s") .option("--timeout <dur>", "Per-command timeout", "10s")
.option("-v, --verbose", "Print each command as it runs") .option("-v, --verbose", "Print each command as it runs")
.option("--parallel", "Run files in parallel") .option("--parallel", "Run files in parallel")
@ -95,7 +95,7 @@ $ true
const fileResult = await runFile(parsed, { const fileResult = await runFile(parsed, {
cleanEnv: opts.cleanEnv ?? false, cleanEnv: opts.cleanEnv ?? false,
pathDirs: opts.path.length > 0 ? opts.path : undefined, pathDirs: opts.path,
timeout: timeoutMs, timeout: timeoutMs,
verbose: opts.verbose ?? false, verbose: opts.verbose ?? false,
onCommand: opts.verbose onCommand: opts.verbose