Skip to content

Commit 180f7cb

Browse files
authored
Make sure platform is a symbol (#379)
* Make sure `platform` is a symbol (hopefully fixes #376). * Explicitly only support iOS and Android.
1 parent 8fef374 commit 180f7cb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Layout/SpaceAroundOperators:
121121
Exclude:
122122
- "**/spec/actions_specs/xcodebuild_spec.rb"
123123
AllCops:
124-
TargetRubyVersion: 2.0
124+
TargetRubyVersion: 2.3
125125
Include:
126126
- "*/lib/assets/*Template"
127127
- "*/lib/assets/*TemplateAndroid"

lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def self.xcode_archive_path
162162
end
163163

164164
def self.lane_platform
165-
Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]
165+
# to_sym shouldn't be necessary, but possibly fixes #376
166+
Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]&.to_sym
166167
end
167168

168169
def self.platform_from_app_id(app_id)
@@ -193,6 +194,9 @@ def self.get_binary_path(platform, params)
193194
Dir["*.apk"].last ||
194195
Dir[File.join("app", "build", "outputs", "apk", "release", "app-release.apk")].last
195196
end
197+
198+
UI.error("Unable to determine binary path for unsupported platform #{platform}.")
199+
nil
196200
end
197201

198202
def self.get_upload_timeout(params)
@@ -586,11 +590,7 @@ def self.available_options
586590
end
587591

588592
def self.is_supported?(platform)
589-
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
590-
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
591-
#
592-
# [:ios, :mac, :android].include?(platform)
593-
true
593+
[:ios, :android].include?(platform)
594594
end
595595

596596
def self.example_code

0 commit comments

Comments
 (0)