- Notifications
You must be signed in to change notification settings - Fork61
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 ind1e5411
if(process.platform==="win32"){ returnchildProcess.exec(`${bsbPath}.cmd -w`,{ cwd:projectRootPath, }); }else{ returnchildProcess.execFile(bsbPath,["-w"],{ cwd:projectRootPath, }); - Sync
execFileSync, that might not call the right windows bsc binary:rescript-vscode/server/src/utils.ts
Line 83 ind1e5411
letresult=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 scriptexecFilein thewin32branch too, to avoid needing to escape path.
- Third one
- should use the right windows bsc binary, if it isn't (where's the needed
.cmdpart?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