diff options
| author | Mike McQuaid | 2016-11-25 08:11:03 +0000 |
|---|---|---|
| committer | GitHub | 2016-11-25 08:11:03 +0000 |
| commit | 7f13b37b903564e2a64cea982d6b84d1aa6b800b (patch) | |
| tree | 111d93b5d3ad0d445ec7cdd12982a6aaeffe577e /Library | |
| parent | 62e0ecdaafbc6779205908c7ab191c884473afd6 (diff) | |
| parent | bb0e683bc47b50a6f054e7d898728fa84c637a64 (diff) | |
| download | brew-7f13b37b903564e2a64cea982d6b84d1aa6b800b.tar.bz2 | |
Merge pull request #1562 from woodruffw/check-admin-group
diagnostic: check if the user is a member of the admin group.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 19148a6ae..edade67bf 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -1069,6 +1069,19 @@ module Homebrew message end + def check_for_member_of_admin_group + groups = Utils.popen_read("groups").split + return unless groups.include?("admin") + + <<-EOS.undent + You are not a member of the "admin" group, which will cause + commands like `brew linkapps` to fail. + + To fix this, you can run: + `sudo dseditgroup -o edit -a $(whoami) -t user admin` + EOS + end + def all methods.map(&:to_s).grep(/^check_/) end |
