fix(core): update CSV handling to account for the the value already being an array (#14722)

This commit is contained in:
Jack Hsu 2023-01-31 11:26:50 -05:00 committed by GitHub
parent 5cee1c19b6
commit 829fb5bbfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -512,7 +512,8 @@ describe('Nx Running Tests', () => {
runCLI(`generate @nrwl/web:app ${myapp2}`); runCLI(`generate @nrwl/web:app ${myapp2}`);
let outputs = runCLI( let outputs = runCLI(
`run-many -t build test -p ${myapp1} ${myapp2} --ci` // Options with lists can be specified using multiple args or with a delimiter (comma or space).
`run-many -t build -t test -p ${myapp1} ${myapp2} --ci`
); );
expect(outputs).toContain('Running targets build, test for 2 projects:'); expect(outputs).toContain('Running targets build, test for 2 projects:');

View File

@ -1017,10 +1017,13 @@ function withWatchOptions(yargs: yargs.Argv) {
}, true); }, true);
} }
function parseCSV(args: string) { function parseCSV(args: string[] | string) {
if (!args) { if (!args) {
return args; return args;
} }
if (Array.isArray(args)) {
return args;
}
return args.split(','); return args.split(',');
} }