]> git.wh0rd.org Git - home.git/commitdiff
better check before running
authorMike Frysinger <vapier@gentoo.org>
Wed, 11 Jan 2012 23:50:58 +0000 (18:50 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 28 Apr 2012 19:36:42 +0000 (15:36 -0400)
.bin/cros-cbuildbot

index 3cdacf0e2e92dfcdd35d5fcd9a1edc880b052de6..81aa94e365caba30f8dcbe4d8b42f67a6181c352 100755 (executable)
@@ -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