Open foohines opened 1 year ago
Shouldn't setting shell
to true
be enough? I tried fixing it in my fork: https://github.com/skayo/tsc-files
Will see if I open a PR, but for now I'll publish my fork as it's own package (@jonasgeiler/tsc-files
)
I don't think so. I tested your fork and my own with just shell: true
, and when a windows user has a space in their tsc path, it still fails with the same error.
This fixes the issue #60 which occurs when:
tsc.cmd
includes a space e.gC:\Users\foohines\code\dir with space\node_modules\.bin\tsc.cmd
This fix works by:
tscPath
in double quotes if it contains a space (passed as spawnSync's first argument)projectArg
in double quotes if it contains a space (passed in spawnSync's second argument){ shell: true }
option to spawnSync for windows users onlyMore context can be found in the node documentation on how to correctly spawn windows .cmd files