zx
zx copied to clipboard
Echo only command output
https://github.com/google/zx/issues/91#issuecomment-845787197
$.verbose = false
await $`program 2>&1`.pipe(process.stdout)
The only way I could get piped commands to actually be captured, and then output it, was the following, which I'm sure could be done better, but was the only thing that worked for me - note I did try using the
.pipe($`someCommand`)
option, but no luck for me, lol! This allows me to just copy some stuff I try at the command line straight in as well, so not too bad :D
let it = (await $`cat db.template.sql | grep 'CREATE TABLE'`).stdout;
console.log(it);
Originally posted by @bradparks in https://github.com/google/zx/issues/91#issuecomment-1382831457
I would like to Collaborator on this issue can you assign me this .
I am planning a big refactoring in the v8 so it's better to leave it for me right now.
Just came here to request this.
Instead of $.verbose
there should be a separate $.echo
(print commands as they are run) and $.quiet
(don't show output).
I am also interested in this feature. Otherwise it's not possible to quietly save values into variables. Its always printed out.
I am planning a big refactoring in the v8 so it's better to leave it for me right now.
I am eagerly awaiting version 8. In the mean time, can we add this foot gun to the Known Issues?