Check for macOS in bootstrap too
This commit is contained in:
committed by
T. R. Bernstein
parent
4fa98ea9a5
commit
2f279a08c7
10
bootstrap.sh
10
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
|
||||
|
||||
Reference in New Issue
Block a user