gobyexample/tools/build-loop
Mark McGranaghan deafc3a0bf handle ctrl-c
2012-10-11 08:00:42 -07:00

22 lines
272 B
Bash
Executable File

#!/bin/bash
TRAPPING=0
trap "{ echo finishing; TRAPPING=1; }" SIGINT
while :
do
tools/build
RET=$?
if [ $RET -eq 0 ]; then
echo "success"
else
echo "error: $RET"
fi
if [ $TRAPPING -eq 0 ]; then
sleep 1
else
echo "done"
exit 0
fi
done