stopped allowing ampersands in file names, added documentation lines.
[feisty_meow.git] / scripts / clam / badness_catcher.sh
1 #!/bin/bash
2 # badness_catcher: runs the command line passed in and catches error conditions.
3
4 if [ ! -z "$NOISY" ]; then
5   echo $*
6 fi
7 eval "$@"
8
9 # get exit status.
10 ERR=$?
11
12 if [ $ERR -eq 0 ]; then exit; fi  # exit if no error.
13
14 # print a complaint since there was an error.
15 echo
16 echo "======================="
17 echo
18 echo "Error in project: \"$PROJECT\""
19 echo "  command was: $*"
20 echo
21 echo "======================="
22 source $CLAM_DIR/exit_make.sh
23 exit $ERR
24