From: Mike Frysinger Date: Wed, 11 Jan 2012 23:50:58 +0000 (-0500) Subject: better check before running X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=70b466db52736b52348219fae2005a01641f5a8e;p=home.git better check before running --- diff --git a/.bin/cros-cbuildbot b/.bin/cros-cbuildbot index 3cdacf0..81aa94e 100755 --- a/.bin/cros-cbuildbot +++ b/.bin/cros-cbuildbot @@ -8,13 +8,19 @@ fi sudo echo "" >/dev/null d=/usr/local/google/home/vapier -if [[ -d ${d} ]] ; then - d+="/trybot" - if mount | grep -qs $d ; then - echo "mounts found in $d" - exit 1 - fi +if [[ ! -d ${d} ]] ; then + exit 1 +fi + +d+="/trybot" +if mount | grep -qs $d ; then + echo "mounts found in $d" + exit 1 +fi +if [[ $1 == "--noclean" ]] ; then + shift +else echo "Cleaning ${d}" pushd "${d}" >/dev/null clean=( @@ -28,8 +34,6 @@ if [[ -d ${d} ]] ; then ) sudo rm -rf "${clean[@]}" popd >/dev/null -else - exit 1 fi # find all the buildbot branches