diff --git a/bootstrap.sh b/bootstrap.sh index ad44029..b9e25bb 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -30,6 +30,10 @@ function printOrLog() { fi } +function isOnMacOS() { + [[ $(uname) == Darwin ]] +} + # ========================== # Install Command Line Tools # ========================== @@ -42,10 +46,6 @@ function majorMinor() { echo "${1%%.*}.$(x="${1#*.}" echo "${x%%.*}")" } -function isOnMacOS() { - [[ $(uname) == Darwin ]] -} - function shouldInstallCommandLineTools() { local macosVersion=$(majorMinor $(/usr/bin/sw_vers -productVersion)) if versionGT "${macosVersion}" "10.13" @@ -87,7 +87,6 @@ function installCommandLineTools() { } function ensureCommandLineTools() { - isOnMacOS || return installCommandLineTools acceptXcodeLicense } @@ -164,6 +163,7 @@ function main() { defineColors configureTerminal + isOnMacOS || { printError 'This library is only supported on macOS.'; return 10 } local tmpdir="`mktemp -d -t 'macos-system'`" isDebug || traps+=("rm -fr -- '${tmpdir}'") trap ${(j.;.)traps} INT TERM EXIT