From 6ef07f47cd66ba1993873d4e6b27b4998a77aa15 Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Thu, 28 Sep 2017 15:59:31 -0400 Subject: [PATCH 1/5] Add support for macOS 10.13 High Sierra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This script on High Sierra works for me. As for dropping legacy support, I’m inclined to do that whenever it becomes a support burden. --- mac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mac b/mac index c52dc1f..41b0472 100755 --- a/mac +++ b/mac @@ -88,8 +88,8 @@ trap exit_message EXIT if [ -n "$DANGER_ZONE" ]; then print_warning "Skipping check of macOS/OS X version. 😎 DANGER ZONE" else - if ! sw_vers -productVersion | grep -q "^10.1[0-2]"; then - print_error "Unsupported OS X version. Please use macOS Sierra, El Capitan, or Yosemite." + if ! sw_vers -productVersion | grep -q "^10.1[0-3]"; then + print_error "Unsupported OS X version. Please use macOS High Sierra, Sierra, El Capitan, or Yosemite." print_error "Or set DANGER_ZONE=1 to proceed anyway." exit 1 fi From 87ea1218ac853983051bc932c64373f4a018f223 Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Thu, 28 Sep 2017 16:07:15 -0400 Subject: [PATCH 2/5] Remove legacy check --- mac | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mac b/mac index 41b0472..ef9a164 100755 --- a/mac +++ b/mac @@ -179,16 +179,6 @@ if ! command -v brew >/dev/null; then print_done fi -# Workaround broken brew update from Aug 11 -# https://github.com/Homebrew/homebrew-core#update-bug -# 1471233600 = Aug 15, 2016, after the issue. -brew_last_change=$(git --git-dir="$(brew --repo)"/.git log -n 1 --pretty=%at) -if [ "$brew_last_change" -le "1471233600" ]; then - print_status "Fixing brew update bug" - (cd "$(brew --repo)"; git fetch; git reset --hard origin/master; brew update) > /dev/null - print_done -fi - # Fix permission issue on /usr/local on OS 10.12 if [ ! -w /usr/local ]; then print_status "Fixing /usr/local permissions issue" From e26c034052b5a7753f8019376a2e14c064ecab7b Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Thu, 28 Sep 2017 16:07:39 -0400 Subject: [PATCH 3/5] Skip /usr/local ownership check on High Sierra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn’t seem needed anymore --- mac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mac b/mac index ef9a164..ad26dde 100755 --- a/mac +++ b/mac @@ -84,7 +84,7 @@ exit_message() { # shellcheck disable=SC2154 trap exit_message EXIT -## Check for OS X >= 10.10, <= 10.12 +## Check for OS X >= 10.10, <= 10.13 if [ -n "$DANGER_ZONE" ]; then print_warning "Skipping check of macOS/OS X version. 😎 DANGER ZONE" else @@ -179,8 +179,9 @@ if ! command -v brew >/dev/null; then print_done fi -# Fix permission issue on /usr/local on OS 10.12 -if [ ! -w /usr/local ]; then +# Fix permission issue on /usr/local on OS 10.12 or less +# NOTE: this may be obsolete +if sw_vers -productVersion | grep -q "^10.1[0-2]" && [ ! -w /usr/local ]; then print_status "Fixing /usr/local permissions issue" sudo chown -R "$(whoami)" /usr/local print_done From 022162fa212575591de65b88da08142f2db1b96f Mon Sep 17 00:00:00 2001 From: Kyle Burckhard Date: Mon, 9 Oct 2017 11:36:33 -0700 Subject: [PATCH 4/5] We can't change /usr/local only its subdirectories --- mac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mac b/mac index ad26dde..0fa6eb4 100755 --- a/mac +++ b/mac @@ -181,9 +181,9 @@ fi # Fix permission issue on /usr/local on OS 10.12 or less # NOTE: this may be obsolete -if sw_vers -productVersion | grep -q "^10.1[0-2]" && [ ! -w /usr/local ]; then +if sw_vers -productVersion | grep -q "^10.1[0-3]" && [ ! -w $(brew --prefix)/Cellar ]; then print_status "Fixing /usr/local permissions issue" - sudo chown -R "$(whoami)" /usr/local + sudo chown -R "$(whoami)" sudo chown -R $(whoami) $(brew --prefix)/* print_done fi From 3b91405c89e317f066f46813dc794d7fce91be85 Mon Sep 17 00:00:00 2001 From: Kyle Burckhard Date: Mon, 9 Oct 2017 12:17:26 -0700 Subject: [PATCH 5/5] Quotes cause shellcheck --- mac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mac b/mac index 0fa6eb4..693721e 100755 --- a/mac +++ b/mac @@ -181,9 +181,9 @@ fi # Fix permission issue on /usr/local on OS 10.12 or less # NOTE: this may be obsolete -if sw_vers -productVersion | grep -q "^10.1[0-3]" && [ ! -w $(brew --prefix)/Cellar ]; then +if sw_vers -productVersion | grep -q "^10.1[0-3]" && [ ! -w "$(brew --prefix)/Cellar" ]; then print_status "Fixing /usr/local permissions issue" - sudo chown -R "$(whoami)" sudo chown -R $(whoami) $(brew --prefix)/* + sudo chown -R "$(whoami)" sudo chown -R "$(whoami)" "$(brew --prefix)"/* print_done fi