-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
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:rescript-vscode/server/src/utils.ts
Lines 107 to 114 in d1e5411
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:rescript-vscode/server/src/utils.ts
Line 83 in d1e5411
let result = childProcess.execFileSync(
We should really revisit those and streamline them:
- First one:
- should be
execFile
, which avoids needing to escape the command path. - should also be sync.
- should work on windows, if it isn't.
- should be
- Second one:
-
should useCan't use that for a batch scriptexecFile
in thewin32
branch too, to avoid needing to escape path.
-
- Third one
- should use the right windows bsc binary, if it isn't (where's the needed
.cmd
part? Windows fixes #71 (comment)).
- should use the right windows bsc binary, if it isn't (where's the needed
Metadata
Metadata
Assignees
Labels
No labels