Merge pull request #10192 from Rylan12/ubuntu-latest-fixes

style shellcheck fixes (in preparation for ubuntu-20.04)
This commit is contained in:
Mike McQuaid 2021-01-05 08:40:21 +00:00 committed by GitHub
commit d526772d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -26,6 +26,9 @@ jobs:
- name: Install Bundler RubyGems
run: brew install-bundler-gems
- name: Install shellcheck
run: brew install shellcheck
- run: brew style --display-cop-names
- run: brew man --fail-if-changed

View File

@ -162,12 +162,13 @@ module Homebrew
end
def run_shellcheck(files, output_type)
shellcheck = which("shellcheck")
shellcheck = Formula["shellcheck"].opt_bin/"shellcheck" if Formula["shellcheck"].any_version_installed?
shellcheck ||= which("shellcheck")
shellcheck ||= which("shellcheck", ENV["HOMEBREW_PATH"])
shellcheck ||= begin
ohai "Installing `shellcheck` for shell style checks..."
safe_system HOMEBREW_BREW_FILE, "install", "shellcheck"
which("shellcheck") || which("shellcheck", ENV["HOMEBREW_PATH"])
Formula["shellcheck"].opt_bin/"shellcheck"
end
if files.empty?