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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isOnMacOS() {
|
||||||
|
[[ $(uname) == Darwin ]]
|
||||||
|
}
|
||||||
|
|
||||||
# ==========================
|
# ==========================
|
||||||
# Install Command Line Tools
|
# Install Command Line Tools
|
||||||
# ==========================
|
# ==========================
|
||||||
@@ -42,10 +46,6 @@ function majorMinor() {
|
|||||||
echo "${1%%.*}.$(x="${1#*.}" echo "${x%%.*}")"
|
echo "${1%%.*}.$(x="${1#*.}" echo "${x%%.*}")"
|
||||||
}
|
}
|
||||||
|
|
||||||
function isOnMacOS() {
|
|
||||||
[[ $(uname) == Darwin ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
function shouldInstallCommandLineTools() {
|
function shouldInstallCommandLineTools() {
|
||||||
local macosVersion=$(majorMinor $(/usr/bin/sw_vers -productVersion))
|
local macosVersion=$(majorMinor $(/usr/bin/sw_vers -productVersion))
|
||||||
if versionGT "${macosVersion}" "10.13"
|
if versionGT "${macosVersion}" "10.13"
|
||||||
@@ -87,7 +87,6 @@ function installCommandLineTools() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ensureCommandLineTools() {
|
function ensureCommandLineTools() {
|
||||||
isOnMacOS || return
|
|
||||||
installCommandLineTools
|
installCommandLineTools
|
||||||
acceptXcodeLicense
|
acceptXcodeLicense
|
||||||
}
|
}
|
||||||
@@ -164,6 +163,7 @@ function main() {
|
|||||||
defineColors
|
defineColors
|
||||||
|
|
||||||
configureTerminal
|
configureTerminal
|
||||||
|
isOnMacOS || { printError 'This library is only supported on macOS.'; return 10 }
|
||||||
local tmpdir="`mktemp -d -t 'macos-system'`"
|
local tmpdir="`mktemp -d -t 'macos-system'`"
|
||||||
isDebug || traps+=("rm -fr -- '${tmpdir}'")
|
isDebug || traps+=("rm -fr -- '${tmpdir}'")
|
||||||
trap ${(j.;.)traps} INT TERM EXIT
|
trap ${(j.;.)traps} INT TERM EXIT
|
||||||
|
|||||||
Reference in New Issue
Block a user