File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,18 +5,12 @@ set -euo pipefail
55# allow this script to be invoked from any folder
66DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
77
8- # macOS detection
9- IS_DARWIN=false
10- if [[ " $( uname) " == " Darwin" ]]; then
11- IS_DARWIN=true
12- fi
13-
14- if $IS_DARWIN && [[ $EUID -eq 0 ]]; then
8+ if [[ " $OSTYPE " == " darwin" * ]] && [[ $EUID -eq 0 ]]; then
159 echo " Do NOT run this script with sudo on macOS"
1610 exit 1
1711fi
1812
19- if ! $IS_DARWIN && [[ $EUID -ne 0 ]]; then
13+ if [[ " $OSTYPE " != " darwin " * ]] && [[ $EUID -ne 0 ]]; then
2014 echo " This script must be run with sudo on Linux"
2115 exit 1
2216fi
@@ -28,7 +22,7 @@ tmpfile=$(mktemp)
2822git submodule status --recursive > " $tmpfile "
2923
3024if grep -q " ^-" " $tmpfile " ; then
31- if $IS_DARWIN ; then
25+ if [[ " $OSTYPE " == " darwin " * ]] ; then
3226 git submodule update --init --recursive
3327 else
3428 sudo -u $SUDO_USER git submodule update --init --recursive
@@ -42,7 +36,7 @@ elif grep -q "^+" "$tmpfile"; then
4236fi
4337
4438" $DIR /etc/DependencyInstaller.sh" -base
45- if $IS_DARWIN ; then
39+ if [[ " $OSTYPE " == " darwin " * ]] ; then
4640 " $DIR /etc/DependencyInstaller.sh" -common -prefix=" $DIR /dependencies"
4741else
4842 sudo -u $SUDO_USER " $DIR /etc/DependencyInstaller.sh" -common -prefix=" $DIR /dependencies"
You can’t perform that action at this time.
0 commit comments