Last active
October 8, 2017 22:49
-
-
Save shakemno/4353e66848d6892f8140066c6d16aa8e to your computer and use it in GitHub Desktop.
gracefully ctrl-c shell bg_task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "starting background workflow..." | |
trap 'trap - SIGINT SIGTERM EXIT; $(kill $BGPID; exit 255)' SIGINT SIGTERM EXIT | |
eval 'gulp workflow &' | |
BGPID=$! | |
wait $BGPID | |
echo "\workflow stopped..." | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment