Added unhappy_ending to happy wrappy
Now happy prints the command line that failed before exiting!
This commit is contained in:
parent
db1918af4e
commit
64066d0172
1 changed files with 6 additions and 1 deletions
|
|
@ -1,2 +1,7 @@
|
|||
# Don't want subsequent commands to run after nonzero exit? Wrappy in happy!
|
||||
happy() { $@ || exit $?; }
|
||||
unhappy_ending() {
|
||||
stat=$1; shift
|
||||
(echo "Error while running: \"$@\"" >&2)
|
||||
exit $stat
|
||||
}
|
||||
happy() { $@ || unhappy_ending $? $@; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue