Silently Breaks without Bash
jpulec opened this issue · 5 comments
It seems that trying to use spawn
with a parameter (i.e. spawn`yarn build --filter=${workspace}`
) breaks if bash is not present. This is because zx
doesn't set a default quote function when it cannot find bash. Normally, this would throw an error, however, since we're wrapping $()
with .nothrow()
in createSpawn()
this issue is silent and makes it appear that our onChange()
handler is hanging forever.
Expected Behavior
Try to support shells besides bash, or at least document this.
Current Behavior
The spawn
command just appears to hang.
Steps to Reproduce
Run spawn
inside onChange()
with a parameter, using an environment that doesn't have bash, i.e. Alpine linux.
@jpulec Will improve error handling for this.
Just my awareness, in what scenario would bash be not available?
The most likely case is when using a minimal distro like Alpine Linux, which uses BusyBox as its default shell, and doesn't include bash. It's fairly common for people to use Alpine when building docker images for their applications to keep the app size down.
That makes sense, though why would you attempt run turbowatch inside a busybox container?
We do all of our development in containers, and in an effort to keep them similar to our production containers, use the same Alpine base image instead of using a different base image for development.
Useful context. Thank you.