@majordigital/create-acorn 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-acorn.mjs +11 -1
- package/package.json +1 -1
package/bin/create-acorn.mjs
CHANGED
|
@@ -70,7 +70,17 @@ function parseFlag(name) {
|
|
|
70
70
|
|
|
71
71
|
function runCommand(cmd, args, options = {}) {
|
|
72
72
|
return new Promise((resolve, reject) => {
|
|
73
|
-
const
|
|
73
|
+
const isWindows = process.platform === 'win32';
|
|
74
|
+
// On Windows, npm/npx are .cmd shims that require a shell to resolve.
|
|
75
|
+
// Quote args containing spaces/special chars so shell parsing preserves them.
|
|
76
|
+
const quotedArgs = isWindows
|
|
77
|
+
? args.map((a) => (/[\s"'&|<>^()]/.test(a) ? `"${a.replace(/"/g, '\\"')}"` : a))
|
|
78
|
+
: args;
|
|
79
|
+
const child = spawn(cmd, quotedArgs, {
|
|
80
|
+
stdio: 'inherit',
|
|
81
|
+
shell: isWindows,
|
|
82
|
+
...options,
|
|
83
|
+
});
|
|
74
84
|
child.on('close', (code) => {
|
|
75
85
|
if (code === 0) resolve();
|
|
76
86
|
else reject(new Error(`${cmd} ${args.join(' ')} exited with code ${code}`));
|
package/package.json
CHANGED