Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Commit dd2f823

Browse files
committed
update logic for testing version of a given CLI path
1 parent 0083788 commit dd2f823

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

features/fixtures/fl-project/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
22

33
gem 'fastlane'
44
gem 'fastlane-plugin-bugsnag'
5-
gem 'abbrev'
5+
gem 'abbrev'

tools/fastlane-plugin/lib/fastlane/plugin/bugsnag/actions/upload_symbols_to_bugsnag.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ def self.get_bugsnag_cli_path(params)
1010
bundled_bugsnag_cli_path = self.bundled_bugsnag_cli_path
1111
bundled_bugsnag_cli_version = Gem::Version.new(`#{bundled_bugsnag_cli_path} --version`.scan(/(?:\d+\.?){3}/).first)
1212

13-
bugsnag_cli_path = params[:bugsnag_cli_path] || bundled_bugsnag_cli_path
13+
if params[:bugsnag_cli_path]
14+
bugsnag_cli_path = params[:bugsnag_cli_path] || bundled_bugsnag_cli_path
1415

15-
bugsnag_cli_version = Gem::Version.new(`#{bugsnag_cli_path} --version`.scan(/(?:\d+\.?){3}/).first)
16+
bugsnag_cli_version = Gem::Version.new(`#{bugsnag_cli_path} --version`.scan(/(?:\d+\.?){3}/).first)
1617

17-
if bugsnag_cli_version < bundled_bugsnag_cli_version
18-
UI.user_error!("Your bugsnag-cli is outdated, please upgrade to at least version #{bundled_bugsnag_cli_version} and start your lane again!")
18+
if bugsnag_cli_version < bundled_bugsnag_cli_version
19+
UI.user_error!("Your bugsnag-cli is outdated, please upgrade to at least version #{bundled_bugsnag_cli_version} and start your lane again!")
20+
end
21+
bugsnag_cli_path
22+
else
23+
bundled_bugsnag_cli_path
1924
end
20-
21-
UI.success("Using bugsnag-cli #{bugsnag_cli_version}")
22-
bugsnag_cli_path
2325
end
2426

2527
def self.run(params)
2628
bugsnag_cli_path = get_bugsnag_cli_path(params)
29+
UI.verbose("Using bugsnag-cli from path: #{bugsnag_cli_path}")
30+
2731
# If we have not explicitly set an API key through env, or parameter
2832
# input in Fastfile, find an API key in the Info.plist in config_file param
2933
api_key = params[:api_key]
@@ -63,7 +67,7 @@ def self.run(params)
6367
params[:xcode_project]
6468
)
6569
bugsnag_cli_command = "#{bugsnag_cli_path} upload dsym #{args.join(' ')}"
66-
UI.message("Running command: #{bugsnag_cli_command}")
70+
UI.verbose("Running command: #{bugsnag_cli_command}")
6771
success = Kernel.system(bugsnag_cli_command)
6872
if success
6973
UI.success("Uploaded dSYMs in #{dsym_path}")
@@ -325,4 +329,4 @@ def self.bin_folder(filename)
325329
end
326330
end
327331
end
328-
end
332+
end

0 commit comments

Comments
 (0)