From bf6ab86454895447808e9f36e2a34e42c81c9293 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 6 Sep 2012 13:04:34 -0400 Subject: [PATCH] handle initial runs better (missing dirs) --- .bin/cros-cbuildbot | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.bin/cros-cbuildbot b/.bin/cros-cbuildbot index 5456f9a..d0fbcc5 100755 --- a/.bin/cros-cbuildbot +++ b/.bin/cros-cbuildbot @@ -1,5 +1,7 @@ #!/bin/bash +set -ex + vexec() { local i fmt for (( i = 1; i <= $#; ++i )) ; do @@ -17,7 +19,7 @@ vexec() { exec "$@" } -cd ~/chromiumos || exit 1 +cd ~/chromiumos # cache the sudo timestamp sudo echo "" >/dev/null @@ -28,14 +30,17 @@ if [[ ! -d ${d} ]] ; then fi d+="/trybot" +mkdir -p "${d}" if mount | grep -qs $d ; then echo "mounts found in $d" exit 1 fi -rd=$(readlink $d) -if mount | grep -qs $rd ; then - echo "mounts found in $rd" - exit 1 +if [[ -L $d ]] ; then + rd=$(readlink $d) + if mount | grep -qs $rd ; then + echo "mounts found in $rd" + exit 1 + fi fi if [[ $1 == "--noclean" ]] ; then -- 2.39.5