edit: add HOMEBREW_NO_INSTALL_FROM_API warning.
This commit is contained in:
parent
e0ba9a1249
commit
2daae5e84d
@ -78,6 +78,19 @@ module Homebrew
|
||||
end.presence
|
||||
end
|
||||
|
||||
if Homebrew::EnvConfig.automatically_set_no_install_from_api? &&
|
||||
!Homebrew::EnvConfig.no_env_hints?
|
||||
paths.each do |path|
|
||||
next if !path.fnmatch?("**/homebrew-core/Formula/*.rb") && !path.fnmatch?("**/homebrew-cask/Casks/*.rb")
|
||||
|
||||
opoo <<~EOS
|
||||
Unless `HOMEBREW_NO_INSTALL_FROM_API` is set when running
|
||||
`brew install`, it will ignore your locally edited formula.
|
||||
EOS
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if args.print_path?
|
||||
paths.each(&method(:puts))
|
||||
return
|
||||
|
||||
@ -13,7 +13,7 @@ describe "brew edit" do
|
||||
|
||||
setup_test_formula "testball"
|
||||
|
||||
expect { brew "edit", "testball", "HOMEBREW_EDITOR" => "/bin/cat" }
|
||||
expect { brew "edit", "testball", "HOMEBREW_EDITOR" => "/bin/cat", "HOMEBREW_NO_ENV_HINTS" => "1" }
|
||||
.to output(/# something here/).to_stdout
|
||||
.and not_to_output.to_stderr
|
||||
.and be_a_success
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user