From 89af10f29ab0ec514b1b426689bbc4721a46cbf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Tue, 20 Aug 2024 16:30:43 -0700 Subject: [PATCH 1/2] dev-cmd/edit: correct path types * Avoids passing the `--project` pseudopath to path checking methods * Ensures the project path is a Pathname, not a String --- Library/Homebrew/dev-cmd/edit.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index becec62708..464d5dab16 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -41,7 +41,7 @@ module Homebrew # Sublime requires opting into the project editing path, # as opposed to VS Code which will infer from the .vscode path if which_editor(silent: true) == "subl" - ["--project", "#{HOMEBREW_REPOSITORY}/.sublime/homebrew.sublime-project"] + ["--project", HOMEBREW_REPOSITORY/".sublime/homebrew.sublime-project"] else # If no formulae are listed, open the project root in an editor. [HOMEBREW_REPOSITORY] @@ -62,6 +62,8 @@ module Homebrew exec_editor(*paths) if paths.any? do |path| + next if path.is_a?(String) && path == "--project" + !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)) From 08c7044598913e40ea140009f206800ddfc77051 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 21 Aug 2024 08:51:04 +0100 Subject: [PATCH 2/2] dev-cmd/edit: simplify flag check. Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> --- Library/Homebrew/dev-cmd/edit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 464d5dab16..26be25488d 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -62,7 +62,7 @@ module Homebrew exec_editor(*paths) if paths.any? do |path| - next if path.is_a?(String) && path == "--project" + next if path == "--project" !Homebrew::EnvConfig.no_install_from_api? && !Homebrew::EnvConfig.no_env_hints? &&