From 519030cae946f9a5b8218d0883aba0c7a0353b41 Mon Sep 17 00:00:00 2001 From: Ethan Brouwer <1647525+eabrouwer3@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:43:48 -0600 Subject: [PATCH] fix: Prevent need for double escaping strings --- actions/start.action.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/actions/start.action.ts b/actions/start.action.ts index de6572b62..5dbc9a692 100644 --- a/actions/start.action.ts +++ b/actions/start.action.ts @@ -160,7 +160,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;