Skip to content

Instantly share code, notes, and snippets.

@jpoehls
Created March 16, 2015 03:43
Show Gist options
  • Save jpoehls/89330b807d31bb4e83f7 to your computer and use it in GitHub Desktop.
Save jpoehls/89330b807d31bb4e83f7 to your computer and use it in GitHub Desktop.
# Kill all background jobs when this script exits
# http://stackoverflow.com/a/2173421
trap 'trap - SIGTERM && kill -- -$$' SIGINT SIGTERM EXIT
which gin
if [ $? -ne 0 ]; then
go get github.com/codegangsta/gin
fi
which goconvey
if [ $? -ne 0 ]; then
go get github.com/smartystreets/goconvey
fi
gin --port 3000 --appPort 3002 &
goconvey --depth=1 --port=3001 &
for job in `jobs -p`
do
echo $job
wait $job
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment