I'll cc @cristianoc, @mewhhaha and @john-pangalos (sorry for the ping) on this one.
Currently in the codebase there are 3 ways to call a binary:
- Async
exec, with path and argument escaping:
|
exec(command, { cwd: executable.cwd }, function (_error, stdout, _stderr) { |
- Async
exec, that doesn't escape path but does use the right windows bsb binary:
|
if (process.platform === "win32") { |
|
return childProcess.exec(`${bsbPath}.cmd -w`, { |
|
cwd: projectRootPath, |
|
}); |
|
} else { |
|
return childProcess.execFile(bsbPath, ["-w"], { |
|
cwd: projectRootPath, |
|
}); |
- Sync
execFileSync, that might not call the right windows bsc binary:
|
let result = childProcess.execFileSync( |
We should really revisit those and streamline them:
- First one:
- Second one:
- Third one
I'll cc @cristianoc, @mewhhaha and @john-pangalos (sorry for the ping) on this one.
Currently in the codebase there are 3 ways to call a binary:
exec, with path and argument escaping:rescript-vscode/server/src/RescriptEditorSupport.ts
Line 48 in d1e5411
exec, that doesn't escape path but does use the right windows bsb binary:rescript-vscode/server/src/utils.ts
Lines 107 to 114 in d1e5411
execFileSync, that might not call the right windows bsc binary:rescript-vscode/server/src/utils.ts
Line 83 in d1e5411
We should really revisit those and streamline them:
execFile, which avoids needing to escape the command path.should useCan't use that for a batch scriptexecFilein thewin32branch too, to avoid needing to escape path..cmdpart? Windows fixes #71 (comment)).