From f4bc2db736fd2d9346c7dfc353940455c7df3f1b Mon Sep 17 00:00:00 2001 From: William Ma Date: Sat, 11 Jul 2020 11:26:11 -0400 Subject: [PATCH] doctor: Disable cask staging path check when running CI, fix style --- Library/Homebrew/diagnostic.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 03dadae1b3..8471c0a7d4 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -882,7 +882,7 @@ module Homebrew Open3.capture2(csrutil, "status") .first .gsub("This is an unsupported configuration, likely to break in " \ - "the future and leave your machine in an unknown state.", "") + "the future and leave your machine in an unknown state.", "") .gsub("System Integrity Protection status: ", "") .delete("\t\.") .capitalize @@ -896,9 +896,6 @@ module Homebrew nil end - # This could be done by calling into Homebrew, but the situation - # where `brew doctor` is needed is precisely the situation where such - # things are less dependable. def check_cask_install_location locations = Dir.glob(HOMEBREW_CELLAR.join("brew-cask", "*")).reverse return if locations.empty? @@ -909,6 +906,9 @@ module Homebrew end def check_cask_staging_location + # Skip this check when running CI since the staging path is not writable for security reasons + return if ENV["HOMEBREW_GITHUB_ACTIONS"] + path = Cask::Caskroom.path add_info "Homebrew Cask Staging Location", user_tilde(path.to_s)