tinylibs / tinyexec

📟 A tiny, higher level interface around child_process
MIT License
100 stars 1 forks source link

improve windows support #12

Closed 43081j closed 2 months ago

43081j commented 2 months ago

This will currently work on windows but in an inconsistent manner.

For example:

x('eslint', ['--help']); // works on linux, fails on windows

x('eslint.cmd', ['--help']); // works on windows, fails on linux

The only solution to this seems to be to use a shell on windows, either by using shell: true or by calling cmd.exe with the target command as an argument.

If we do that, we may need to escape some things (e.g. the command name if it has spaces in).