about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2019-05-08T11·16-0400
committerGitHub <noreply@github.com>2019-05-08T11·16-0400
commit5713772568487e6c402547d8d4c0651a2cbe0472 (patch)
tree6cffd7a43df57435a30b23a7f424c03dc651c8ff
parent71eb76a0d462de699b080abee6f3b4a978f6adc1 (diff)
parent82f054d7d5fc8f9de45afa7107557644d1514c98 (diff)
Merge pull request #2594 from LnL7/darwin-10.12.6
installer: update macOS version check to 10.12.2
-rw-r--r--scripts/install-nix-from-closure.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh
index 7810a6461be3..4dd249923b54 100644
--- a/scripts/install-nix-from-closure.sh
+++ b/scripts/install-nix-from-closure.sh
@@ -22,10 +22,12 @@ if [ -z "$HOME" ]; then
     exit 1
 fi
 
-# macOS support for 10.10 or higher
+# macOS support for 10.12.6 or higher
 if [ "$(uname -s)" = "Darwin" ]; then
-    if [ $(($(sw_vers -productVersion | cut -d '.' -f 2))) -lt 10 ]; then
-        echo "$0: macOS $(sw_vers -productVersion) is not supported, upgrade to 10.10 or higher"
+    macos_major=$(sw_vers -productVersion | cut -d '.' -f 2)
+    macos_minor=$(sw_vers -productVersion | cut -d '.' -f 3)
+    if [ "$macos_major" -lt 12 ] || ([ "$macos_major" -eq 12 ] && [ "$macos_minor" -lt 6 ]); then
+        echo "$0: macOS $(sw_vers -productVersion) is not supported, upgrade to 10.12.6 or higher"
         exit 1
     fi
 fi