diff --git a/build.sh b/build.sh index 41628b5ba..ace6ae66a 100755 --- a/build.sh +++ b/build.sh @@ -101,11 +101,12 @@ FILE=.buildtools OS_NAME=`uname -a` if [ ! -f $FILE ]; then case "$OS_NAME" in - *Darwin*) tools/setup-buildtools-apple.sh $MAC_ARCH ;; - *Linux*) [[ -z "$NOROOT" ]] && sudo tools/setup-buildtools.sh || echo "No root: skipping build tools installation." ;; - *) echo "WARNING: unsupported OS $OS_NAME , skipping build tools installation.." + *Darwin*) CMD="tools/setup-buildtools-apple.sh $MAC_ARCH" ;; + *Linux*) CMD="tools/setup-buildtools.sh" ;; + *) echo "WARNING: unsupported OS $OS_NAME, skipping build tools installation.." && exit 1 ;; esac - # Assume that the build tools have been successfully installed + + [[ -z "$NOROOT" ]] && sudo $CMD || $CMD echo > $FILE fi