From 9bbdbef8ce863997f3cc47e1cdaf172a230c132a Mon Sep 17 00:00:00 2001 From: Rahul Kumar Date: Tue, 21 Jan 2025 02:47:14 +0530 Subject: [PATCH] Fix argument handling with spaces in neu run --- src/commands/run.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands/run.js b/src/commands/run.js index ac001fd..b66ee34 100644 --- a/src/commands/run.js +++ b/src/commands/run.js @@ -5,6 +5,12 @@ const utils = require('../utils'); const config = require('../modules/config'); const frontendlib = require('../modules/frontendlib'); const hostproject = require('../modules/hostproject'); +function wrapQuotedArguments(arg) { + if (arg.includes(' ') && !arg.startsWith('"') && !arg.endsWith('"')) { + return `"${arg}"`; + } + return arg; +} module.exports.register = (program) => { program @@ -42,6 +48,7 @@ module.exports.register = (program) => { if(parseStopIndex != -1) { argsOpt += ' ' + process.argv .slice(parseStopIndex + 1) + .map(wrapQuotedArguments) .join(' '); }