Skip to content

Commit

Permalink
Fastlane sh with log set to false should respect a step name (fastlan…
Browse files Browse the repository at this point in the history
  • Loading branch information
mollyIV authored Jul 26, 2024
1 parent 9bc8429 commit ac23bcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fastlane/lib/fastlane/fast_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fastlane/spec/fast_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ac23bcd

Please sign in to comment.