Skip to content

Commit 6163400

Browse files
authored
Merge pull request #19622 from abitrolly/actionable-edit
dev-cmd/edit: Actionable message about no API install
2 parents 4585121 + e98a052 commit 6163400

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Library/Homebrew/dev-cmd/edit.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,18 @@ def run
6363

6464
exec_editor(*paths)
6565

66-
if paths.any? do |path|
66+
is_formula = T.let(false, T::Boolean)
67+
if !Homebrew::EnvConfig.no_env_hints? && paths.any? do |path|
6768
next if path == "--project"
6869

69-
!Homebrew::EnvConfig.no_install_from_api? &&
70-
!Homebrew::EnvConfig.no_env_hints? &&
71-
(core_formula_path?(path) || core_cask_path?(path) || core_formula_tap?(path) || core_cask_tap?(path))
70+
is_formula = core_formula_path?(path)
71+
is_formula || core_cask_path?(path) || core_formula_tap?(path) || core_cask_tap?(path)
7272
end
73-
opoo <<~EOS
74-
`brew install` ignores locally edited casks and formulae if
75-
HOMEBREW_NO_INSTALL_FROM_API is not set.
73+
from_source = " --build-from-source" if is_formula
74+
no_api = "HOMEBREW_NO_INSTALL_FROM_API=1 " unless Homebrew::EnvConfig.no_install_from_api?
75+
puts <<~EOS
76+
To test your local edits, run:
77+
#{no_api}brew install#{from_source} --verbose --debug #{args.named.join(" ")}
7678
EOS
7779
end
7880
end

0 commit comments

Comments
 (0)