Skip to content

Commit

Permalink
Merge pull request #2244 from eabrouwer3/eb/2242-json-cli-option
Browse files Browse the repository at this point in the history
fix: Prevent need for double escaping strings
  • Loading branch information
kamilmysliwiec committed Sep 21, 2023
2 parents 484d20a + 519030c commit e2e046f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion actions/start.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ export class StartAction extends BuildAction {
let childProcessArgs: string[] = [];
const argsStartIndex = process.argv.indexOf('--');
if (argsStartIndex >= 0) {
childProcessArgs = process.argv.slice(argsStartIndex + 1);
// Prevents the need for users to double escape strings
// i.e. I can run the more natural
// nest start -- '{"foo": "bar"}'
// instead of
// nest start -- '\'{"foo": "bar"}\''
childProcessArgs = process.argv.slice(argsStartIndex + 1)
.map(arg => JSON.stringify(arg));
}
outputFilePath =
outputFilePath.indexOf(' ') >= 0 ? `"${outputFilePath}"` : outputFilePath;
Expand Down

0 comments on commit e2e046f

Please sign in to comment.