Skip to content

Commit 0a94acf

Browse files
committed
Fix tools detection in $PATH
1 parent 7c152d3 commit 0a94acf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_tools_path_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ def find_tool_path(binary:, search_paths:)
2525
end
2626

2727
# If not found in any of the `search_paths`, try to look for it in $PATH
28-
bin_path ||= Action.sh('command', '-v', binary, print_command_output: false) { |_| nil }.chomp
28+
bin_path ||= Actions.sh('command', '-v', binary) { |err, res, _| res if err&.success? }&.chomp
2929

30-
# Normalize return value to `nil` if it was not found or is not an executable
31-
bin_path = nil if bin_path.empty? || !File.executable?(bin_path)
30+
# Normalize return value to `nil` if it was not found, empty, or is not an executable
31+
bin_path = nil if !bin_path.nil? && (bin_path.empty? || !File.executable?(bin_path))
3232

3333
bin_path
3434
end

0 commit comments

Comments
 (0)