diff options
| author | Vítor Galvão | 2018-01-14 04:21:18 +0000 | 
|---|---|---|
| committer | GitHub | 2018-01-14 04:21:18 +0000 | 
| commit | 42be54ebdec044a6a01f096d77f19bda1981084a (patch) | |
| tree | 93e206e8330b3f4d9f7c16f4308232ac8f15da24 | |
| parent | 9a82eb6212ac504cff9eb4ea80e0bbecada21440 (diff) | |
| parent | e870c1783f5c4f420b094a9f6b8a47457d920cb2 (diff) | |
| download | brew-42be54ebdec044a6a01f096d77f19bda1981084a.tar.bz2 | |
Merge pull request #3667 from commitay/cask-doctor-sip
cask doctor: sip status
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/doctor.rb | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb index d7bcf1537..5aef2c420 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb @@ -12,6 +12,7 @@ module Hbc        def run          ohai "Homebrew-Cask Version", Hbc.full_version          ohai "macOS", MacOS.full_version +        ohai "SIP", self.class.check_sip          ohai "Java", SystemConfig.describe_java          ohai "Homebrew-Cask Install Location", self.class.render_install_location          ohai "Homebrew-Cask Staging Location", self.class.render_staging_location(Hbc.caskroom) @@ -37,6 +38,15 @@ module Hbc          (self.class.locale_variables + environment_variables).sort.each(&self.class.method(:render_env_var))        end +      def self.check_sip +        csrutil = "/usr/bin/csrutil" +        return "N/A" unless File.executable?(csrutil) +        Open3.capture2(csrutil, "status")[0] +             .gsub("This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.", "") +             .gsub("System Integrity Protection status: ", "") +             .delete("\t\.").capitalize.strip +      end +        def self.locale_variables          ENV.keys.grep(/^(?:LC_\S+|LANG|LANGUAGE)\Z/).sort        end | 
