From 70b466db52736b52348219fae2005a01641f5a8e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 11 Jan 2012 18:50:58 -0500 Subject: [PATCH] better check before running --- .bin/cros-cbuildbot | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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 -- 2.39.5