Skip to content

Commit

Permalink
windows: Fix Windows server install with installDir containing space (#…
Browse files Browse the repository at this point in the history
…1471)

* Fix server install with installDir containing space

* Revert "Fix server install with installDir containing space"

This reverts commit b99ccd3.

* Alternate fix by wrapping each runCommand arg in a quote for Windows
  • Loading branch information
longzheng authored May 15, 2024
1 parent 390d1b3 commit 72422cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cli/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ const EXIT_FILE = '.exit';
const UPDATE_FILE = '.update';

async function runCommand(command: string, ...args: string[]) {
if (os.platform() === 'win32')
if (os.platform() === 'win32') {
command += '.cmd';
// wrap each argument in a quote to handle spaces in paths
// https://github.com/nodejs/node/issues/38490#issuecomment-927330248
args = args.map(arg => '"' + arg + '"');
}
console.log('running', command, ...args);
const cp = child_process.spawn(command, args, {
stdio: 'inherit',
Expand Down

0 comments on commit 72422cd

Please sign in to comment.