Fix repeatable flags in config

Fixes #6149.
This commit is contained in:
Asher
2025-05-05 12:46:24 -08:00
committed by Asher
parent 0c72b20fa7
commit c8257a3074
2 changed files with 30 additions and 6 deletions

View File

@@ -713,12 +713,16 @@ export function parseConfigFile(configFile: string, configPath: string): ConfigA
// We convert the config file into a set of flags.
// This is a temporary measure until we add a proper CLI library.
const configFileArgv = Object.entries(config).map(([optName, opt]) => {
if (opt === true) {
return `--${optName}`
}
return `--${optName}=${opt}`
})
const configFileArgv = Object.entries(config)
.map(([optName, opt]) => {
if (opt === true) {
return `--${optName}`
} else if (Array.isArray(opt)) {
return opt.map((o) => `--${optName}=${o}`)
}
return `--${optName}=${opt}`
})
.flat()
const args = parse(configFileArgv, {
configFile: configPath,
})