From bf87339bfb437aa51ac394242e8e51d517f0dd65 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 2 Jun 2024 16:05:08 +0300 Subject: [PATCH] dev-cmd/edit: Show API install warning after the edit is done --- Library/Homebrew/dev-cmd/edit.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index cbea9d7320..becec62708 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -51,17 +51,6 @@ module Homebrew expanded_paths.each do |path| raise_with_message!(path, args.cask?) unless path.exist? end - - if expanded_paths.any? do |path| - !Homebrew::EnvConfig.no_install_from_api? && - !Homebrew::EnvConfig.no_env_hints? && - (core_formula_path?(path) || core_cask_path?(path) || core_formula_tap?(path) || core_cask_tap?(path)) - end - opoo <<~EOS - `brew install` ignores locally edited casks and formulae if - HOMEBREW_NO_INSTALL_FROM_API is not set. - EOS - end expanded_paths end @@ -71,6 +60,17 @@ module Homebrew end exec_editor(*paths) + + if paths.any? do |path| + !Homebrew::EnvConfig.no_install_from_api? && + !Homebrew::EnvConfig.no_env_hints? && + (core_formula_path?(path) || core_cask_path?(path) || core_formula_tap?(path) || core_cask_tap?(path)) + end + opoo <<~EOS + `brew install` ignores locally edited casks and formulae if + HOMEBREW_NO_INSTALL_FROM_API is not set. + EOS + end end private