@cccarv82/freya 3.7.4 → 3.7.5
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/cli/web.js +15 -2
- package/package.json +1 -1
package/cli/web.js
CHANGED
|
@@ -970,8 +970,21 @@ function run(cmd, args, cwd, extraEnv, stdinData) {
|
|
|
970
970
|
const env = extraEnv ? { ...process.env, ...extraEnv } : process.env;
|
|
971
971
|
|
|
972
972
|
try {
|
|
973
|
-
|
|
974
|
-
|
|
973
|
+
if (process.platform === 'win32') {
|
|
974
|
+
// Use PowerShell — fnm/nvm set PATH only in PowerShell profile,
|
|
975
|
+
// so cmd.exe (shell:true) can't find npm global .cmd shims like copilot.
|
|
976
|
+
// Do NOT use -NoProfile: the profile is what loads fnm/nvm PATH entries.
|
|
977
|
+
const escapedArgs = args.map(a => {
|
|
978
|
+
const escaped = String(a).replace(/'/g, "''");
|
|
979
|
+
return `'${escaped}'`;
|
|
980
|
+
});
|
|
981
|
+
const psCommand = `& '${cmd}' ${escapedArgs.join(' ')}`;
|
|
982
|
+
child = spawn('powershell.exe', [
|
|
983
|
+
'-NoLogo', '-Command', psCommand
|
|
984
|
+
], { cwd, env, windowsHide: true });
|
|
985
|
+
} else {
|
|
986
|
+
child = spawn(cmd, args, { cwd, shell: true, env });
|
|
987
|
+
}
|
|
975
988
|
} catch (e) {
|
|
976
989
|
return resolve({ code: 1, stdout: '', stderr: e.message || String(e) });
|
|
977
990
|
}
|
package/package.json
CHANGED