From b41dd8c7296fbfb1d9635ebdb07918d7f600b245 Mon Sep 17 00:00:00 2001 From: Max Eisner <4730112+max-ae@users.noreply.github.com> Date: Fri, 2 Sep 2022 15:40:24 +0200 Subject: [PATCH 1/3] generate_completions: fix `shell_parameter_format: :none` --- Library/Homebrew/formula.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index aedb036b8c..4fb028529b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1745,14 +1745,14 @@ class Formula elsif shell_parameter_format == :arg "--shell=#{shell}" elsif shell_parameter_format == :none - "" + nil else "#{shell_parameter_format}#{shell}" end popen_read_args = %w[] popen_read_args << commands - popen_read_args << shell_parameter + popen_read_args << shell_parameter unless shell_parameter.nil? popen_read_args.flatten! script_path.dirname.mkpath From 02860aa0e87826e0c6083137fdeb7e1a0468e902 Mon Sep 17 00:00:00 2001 From: Max Eisner <4730112+max-ae@users.noreply.github.com> Date: Fri, 2 Sep 2022 22:23:26 +0200 Subject: [PATCH 2/3] use `#blank?` instead of `#nil?` Co-authored-by: Rylan Polster --- Library/Homebrew/formula.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 4fb028529b..fd06e6e568 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1752,7 +1752,7 @@ class Formula popen_read_args = %w[] popen_read_args << commands - popen_read_args << shell_parameter unless shell_parameter.nil? + popen_read_args << shell_parameter unless shell_parameter.blank? popen_read_args.flatten! script_path.dirname.mkpath From 20e432c0d5a14886a98222bc59e0a4e7d7660d3b Mon Sep 17 00:00:00 2001 From: Max Eisner <4730112+max-ae@users.noreply.github.com> Date: Fri, 2 Sep 2022 22:26:58 +0200 Subject: [PATCH 3/3] fix style --- Library/Homebrew/formula.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fd06e6e568..f7b7ae033f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1752,7 +1752,7 @@ class Formula popen_read_args = %w[] popen_read_args << commands - popen_read_args << shell_parameter unless shell_parameter.blank? + popen_read_args << shell_parameter if shell_parameter.present? popen_read_args.flatten! script_path.dirname.mkpath