Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit b9430e3

Browse files
authored
fix(ns-bundle): escape arguments passed to tns command (#125)
When spawning a child process, the arguments should be escape in order to arguments with special chars (such as spaces) in them to work. fixes #123
1 parent c06589f commit b9430e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: bin/ns-bundle

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!process.env.npm_config_argv) {
1010
}
1111

1212
const npmArgs = JSON.parse(process.env.npm_config_argv).original;
13-
const tnsArgs = getTnsArgs(npmArgs);
13+
const tnsArgs = getTnsArgs(npmArgs).map(escape);
1414
const flags = npmArgs.filter(a => a.startsWith("--")).map(a => a.substring(2));
1515
const options = getOptions(flags);
1616

@@ -29,6 +29,10 @@ function getTnsArgs(args) {
2929
return args.filter(a => !other.includes(a));
3030
}
3131

32+
function escape(arg) {
33+
return `"${arg}"`;
34+
}
35+
3236
execute(options);
3337

3438
function execute(options) {

0 commit comments

Comments
 (0)