mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
style: use Homebrew shellcheck if installed
This commit is contained in:
parent
65df4efd1a
commit
bcac46bccb
@ -162,12 +162,13 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def run_shellcheck(files, output_type)
|
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 ||= which("shellcheck", ENV["HOMEBREW_PATH"])
|
||||||
shellcheck ||= begin
|
shellcheck ||= begin
|
||||||
ohai "Installing `shellcheck` for shell style checks..."
|
ohai "Installing `shellcheck` for shell style checks..."
|
||||||
safe_system HOMEBREW_BREW_FILE, "install", "shellcheck"
|
safe_system HOMEBREW_BREW_FILE, "install", "shellcheck"
|
||||||
which("shellcheck") || which("shellcheck", ENV["HOMEBREW_PATH"])
|
Formula["shellcheck"].opt_bin/"shellcheck"
|
||||||
end
|
end
|
||||||
|
|
||||||
if files.empty?
|
if files.empty?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user