Skip to content

Commit

Permalink
Merge pull request #49 from kickstarter/macos-10.13-high-sierra
Browse files Browse the repository at this point in the history
Add support for macOS 10.13 High Sierra
  • Loading branch information
talaris authored Oct 9, 2017
2 parents 0c3cbea + 3b91405 commit edf6c73
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions mac
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ 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
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
Expand Down Expand Up @@ -179,20 +179,11 @@ 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
# 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
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

Expand Down

0 comments on commit edf6c73

Please sign in to comment.