How is zx supposed to be used on Windows? #784
Unanswered
msssk
asked this question in
Help needed
Replies: 2 comments
-
We definitely can think of the way of improving zx DX on windows. But I think true cross platform support is out of the scope of zx project. For example: zx dependency on bash. |
Beta Was this translation helpful? Give feedback.
0 replies
-
We've introduced a couple of helpers to make setup a little easier for Windows users. https://google.github.io/zx/setup#bash import {usePwsh, $} from 'zx'
if (process.platform === 'win32') {
usePwsh() // now `$.shell` refers to pwsh and `$.postfix` set to '; exit $LastExitCode'
}
// ...
const foo = await $`bar baz` |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A big part of the appeal of zx for me is the possibility of writing cross-platform scripts that involve file manipulation.
The out-of-the-box Windows experience needs significant improvement for this to be reality.
Like many developers I have WSL installed. When I run zx it attempts (and fails) to use WSL bash. Even if this succeeded it is not what I want when I execute a script from cmd - I want access to my current environment. I eventually discovered I could set
$.shell
to Git'sbash.exe
but this does not result in an easily shareable cross-platform script.Beta Was this translation helpful? Give feedback.
All reactions