style: brew style always use latest brewed shellcheck
This commit is contained in:
parent
bc0663baba
commit
2855ae18df
@ -164,14 +164,17 @@ module Homebrew
|
||||
end
|
||||
|
||||
def run_shellcheck(files, output_type)
|
||||
shellcheck = Formula["shellcheck"].opt_bin/"shellcheck" if Formula["shellcheck"].latest_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"
|
||||
Formula["shellcheck"].opt_bin/"shellcheck"
|
||||
# Always use the latest brewed shellcheck
|
||||
unless Formula["shellcheck"].latest_version_installed?
|
||||
if Formula["shellcheck"].any_version_installed?
|
||||
ohai "Upgrading `shellcheck` for shell style checks..."
|
||||
safe_system HOMEBREW_BREW_FILE, "upgrade", "shellcheck"
|
||||
else
|
||||
ohai "Installing `shellcheck` for shell style checks..."
|
||||
safe_system HOMEBREW_BREW_FILE, "install", "shellcheck"
|
||||
end
|
||||
end
|
||||
shellcheck = Formula["shellcheck"].opt_bin/"shellcheck"
|
||||
|
||||
if files.empty?
|
||||
files = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user