From d64d055835bc29edd1543f7a711c3687d8bc3b94 Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 28 May 2024 22:14:22 -0700 Subject: [PATCH] use sudo for macos --- build.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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