Skip to content

Commit

Permalink
/usr/local can no longer be chown'd in High Sierra
Browse files Browse the repository at this point in the history
As a workaround, execute the command to the subdirectory.

The error message was:
```
chown: changing ownership of '/usr/local': Operation not permitted
```

See also:
- Homebrew/brew#3228
- https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-osx-10-13-high-sierra
  • Loading branch information
machupicchubeta committed Oct 4, 2017
1 parent 47cc0af commit 28bdcda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/brewfile.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -eu
sudo chown -R $(whoami):admin $(brew --prefix)
sudo chown -R $(whoami):admin $(brew --prefix)/*
cd $(brew --repository) && git checkout master
cd -

Expand Down
2 changes: 1 addition & 1 deletion bin/convert_brewfile_to_shell_script.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File.open ARGV[0] do |brewfile|
puts '#!/bin/sh'
puts 'set -eu'
puts 'sudo chown -R $(whoami):admin $(brew --prefix)'
puts 'sudo chown -R $(whoami):admin $(brew --prefix)/*'
puts 'cd $(brew --repository) && git checkout master'
puts 'cd -'

Expand Down

0 comments on commit 28bdcda

Please sign in to comment.