From ac23bcd5d51765c70daa53eb39b8cbe1daa1a754 Mon Sep 17 00:00:00 2001 From: Daniel Jankowski Date: Fri, 26 Jul 2024 08:16:06 +0200 Subject: [PATCH] Fastlane sh with log set to false should respect a step name (#22151) --- fastlane/lib/fastlane/fast_file.rb | 4 +++- fastlane/spec/fast_file_spec.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fastlane/lib/fastlane/fast_file.rb b/fastlane/lib/fastlane/fast_file.rb index 149c0619dc0..c940f3e2896 100644 --- a/fastlane/lib/fastlane/fast_file.rb +++ b/fastlane/lib/fastlane/fast_file.rb @@ -218,7 +218,9 @@ def sh(*args, &b) end def self.sh(*command, step_name: nil, log: true, error_callback: nil, &b) - command_header = log ? step_name || Actions.shell_command_from_args(*command) : "shell command" + command_header = step_name + command_header ||= log ? Actions.shell_command_from_args(*command) : "shell command" + Actions.execute_action(command_header) do Actions.sh_no_action(*command, log: log, error_callback: error_callback, &b) end diff --git a/fastlane/spec/fast_file_spec.rb b/fastlane/spec/fast_file_spec.rb index bb1504c4080..f3cb0cd2b95 100644 --- a/fastlane/spec/fast_file_spec.rb +++ b/fastlane/spec/fast_file_spec.rb @@ -49,7 +49,7 @@ end it "passes command as string, step_name, and log false with default error_callback" do - expect(Fastlane::Actions).to receive(:execute_action).with("shell command").and_call_original + expect(Fastlane::Actions).to receive(:execute_action).with("some_name").and_call_original expect(Fastlane::Actions).to receive(:sh_no_action) .with("git commit", log: false, error_callback: nil)