include the crit command in jenkins build script

This commit is contained in:
Spencer Alger
2015-01-13 18:05:46 -07:00
parent 22e25ef77a
commit e7715916fe

View File

@ -20,6 +20,17 @@ function release_lock {
echo "cleared lock file $lockpath"
}
# execute a command, and exit if it fails
function crit {
$*
CODE=$?
if [[ $CODE -gt 0 ]]; then
echo "last command was critical, but it reported non-zero exit code $CODE";
release_lock # clear any locks
exit $CODE;
fi
}
# install a specific version of Node and the latest version of NPM within that install
function install_node {
local version=$1
@ -48,7 +59,6 @@ function install_node {
fi
}
get_lock
install_node "$NODE_V"
npm install