busyloop / lolcat

Rainbows and unicorns!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request - forward exit code of previous program

davidaramant opened this issue · comments

It would be nice if there were an option to use the return code of the previous program, so that (for example) really-long-build | lolcat would return a failure code if the build failed.

The really-long-build is out of our hands. We've actually found that piping the output to lolcat makes the errors stand out more (since stderr is not recolored) 😄

commented

You don't need lolcat to pass that through.
Shells have the handy $PIPESTATUS and pipefail
for exactly this purpose :)

https://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another

Whoops, yeah, I didn't even check if it was possible before I posted this. Apparently an app receiving data over a pipe can't get the exit code of the previous program, anyway.