From 2f279a08c721d9119660dc25bac5a054fa68ef0a Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" <137705289+trbernstein@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:58:59 +0200 Subject: [PATCH] Check for macOS in bootstrap too --- bootstrap.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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