File tree Expand file tree Collapse file tree 5 files changed +28
-46
lines changed
lib/fastlane/plugin/bugsnag/actions Expand file tree Collapse file tree 5 files changed +28
-46
lines changed Original file line number Diff line number Diff line change 11require 'os'
22require 'rbconfig'
33
4- class BundledCli
5- def self . get_path
4+ class BugsnagCli
5+ def self . get_bugsnag_cli_path ( params )
6+ bundled_bugsnag_cli_path = self . get_bundled_path
7+ bundled_bugsnag_cli_version = Gem ::Version . new ( `#{ bundled_bugsnag_cli_path } --version` . scan ( /(?:\d +\. ?){3}/ ) . first )
8+
9+ if params [ :bugsnag_cli_path ]
10+ bugsnag_cli_path = params [ :bugsnag_cli_path ] || bundled_bugsnag_cli_path
11+
12+ bugsnag_cli_version = Gem ::Version . new ( `#{ bugsnag_cli_path } --version` . scan ( /(?:\d +\. ?){3}/ ) . first )
13+
14+ if bugsnag_cli_version < bundled_bugsnag_cli_version
15+ UI . warning ( "Your bugsnag-cli is outdated. The current bugsnag-cli version is: #{ bundled_bugsnag_cli_version } " )
16+ end
17+ bugsnag_cli_path
18+ else
19+ bundled_bugsnag_cli_path
20+ end
21+ end
22+
23+ def self . get_bundled_path
624 host_cpu = RbConfig ::CONFIG [ 'host_cpu' ]
725 if OS . mac?
826 if host_cpu =~ /arm|aarch64/
Original file line number Diff line number Diff line change 11require "xmlsimple"
22require "json"
33require_relative "find_info_plist_path"
4- require_relative "bundled_cli_path "
4+ require_relative "bugsnag_cli "
55
66module Fastlane
77 module Actions
88 class SendBuildToBugsnagAction < Action
9- def self . get_bugsnag_cli_path ( params )
10- bundled_bugsnag_cli_path = BundledCli . get_path
11- bundled_bugsnag_cli_version = Gem ::Version . new ( `#{ bundled_bugsnag_cli_path } --version` . scan ( /(?:\d +\. ?){3}/ ) . first )
12-
13- if params [ :bugsnag_cli_path ]
14- bugsnag_cli_path = params [ :bugsnag_cli_path ] || bundled_bugsnag_cli_path
15-
16- bugsnag_cli_version = Gem ::Version . new ( `#{ bugsnag_cli_path } --version` . scan ( /(?:\d +\. ?){3}/ ) . first )
17-
18- if bugsnag_cli_version < bundled_bugsnag_cli_version
19- UI . warning ( "Your bugsnag-cli is outdated. The current bugsnag-cli version is: #{ bundled_bugsnag_cli_version } " )
20- end
21- bugsnag_cli_path
22- else
23- bundled_bugsnag_cli_path
24- end
25- end
26-
279 def self . run ( params )
28- bugsnag_cli_path = get_bugsnag_cli_path ( params )
10+ bugsnag_cli_path = BugsnagCli . get_bugsnag_cli_path ( params )
2911 UI . verbose ( "Using bugsnag-cli from path: #{ bugsnag_cli_path } " )
3012
3113 payload = { }
Original file line number Diff line number Diff line change 11require_relative "find_info_plist_path"
2- require_relative "bundled_cli_path "
2+ require_relative "bugsnag_cli "
33
44
55module Fastlane
66 module Actions
77 class UploadSymbolsToBugsnagAction < Action
8- def self . get_bugsnag_cli_path ( params )
9- bundled_bugsnag_cli_path = BundledCli . get_path
10- bundled_bugsnag_cli_version = Gem ::Version . new ( `#{ bundled_bugsnag_cli_path } --version` . scan ( /(?:\d +\. ?){3}/ ) . first )
11-
12- if params [ :bugsnag_cli_path ]
13- bugsnag_cli_path = params [ :bugsnag_cli_path ] || bundled_bugsnag_cli_path
14-
15- bugsnag_cli_version = Gem ::Version . new ( `#{ bugsnag_cli_path } --version` . scan ( /(?:\d +\. ?){3}/ ) . first )
16-
17- if bugsnag_cli_version < bundled_bugsnag_cli_version
18- UI . warning ( "Your bugsnag-cli is outdated. The current bugsnag-cli version is: #{ bundled_bugsnag_cli_version } " )
19- end
20- bugsnag_cli_path
21- else
22- bundled_bugsnag_cli_path
23- end
24- end
25-
268 def self . run ( params )
27- bugsnag_cli_path = get_bugsnag_cli_path ( params )
9+ bugsnag_cli_path = BugsnagCli . get_bugsnag_cli_path ( params )
2810 UI . verbose ( "Using bugsnag-cli from path: #{ bugsnag_cli_path } " )
2911
3012 # If we have not explicitly set an API key through env, or parameter
Original file line number Diff line number Diff line change 11require 'spec_helper'
2- require_relative '../lib/fastlane/plugin/bugsnag/actions/bundled_cli_path '
2+ require_relative '../lib/fastlane/plugin/bugsnag/actions/bugsnag_cli '
33
44Action = Fastlane ::Actions ::UploadSymbolsToBugsnagAction
5- BUGSNAG_CLI_PATH = BundledCli . get_path
5+ BUGSNAG_CLI_PATH = BugsnagCli . get_bundled_path
66
77describe Action do
88 def run_with args
Original file line number Diff line number Diff line change 11require 'spec_helper'
22require 'json'
33require 'fastlane/actions/get_info_plist_value'
4- require_relative '../lib/fastlane/plugin/bugsnag/actions/bundled_cli_path '
4+ require_relative '../lib/fastlane/plugin/bugsnag/actions/bugsnag_cli '
55
66
77BuildAction = Fastlane ::Actions ::SendBuildToBugsnagAction
8- BUGSNAG_CLI_PATH = BundledCli . get_path
8+ BUGSNAG_CLI_PATH = BugsnagCli . get_bundled_path
99
1010
1111describe BuildAction do
You can’t perform that action at this time.
0 commit comments