You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are reasons to want to avoid embedding shell syntax into tasks if we can. Once we use shell syntax ruby automatically switches to shelling out to the default shell rather than executing the process directly. Among other issues, this exposes us to more expansion surprises, differences of behavior on different systems, and commands that flat-out don't work on some platforms. It also opens up security considerations in any context where we may be interpolating info from an untrusted source. Maybe rare for Rake scripts, but possible.
Avoiding shelling out is always the safer and more predictable option. It would be nice to be able to do the safe thing and still have a reasonable echo of how to reproduce it from the command line.
Given the task
foo
, which uses thesh
helper withProcess.spawn
-style options:Currently, running this task reveals environment variables in shell-command style, but not the output sink.
$ rake foo FOO=BAR ls manuscript/*.md
Suggested behavior is to reveal the output sink as a simulated shell redirect:
The text was updated successfully, but these errors were encountered: