Skip to content

Commit

Permalink
[pilot] add xros as valid option for pilot upload (#21841)
Browse files Browse the repository at this point in the history
* add xros to pilot appstore upload

* the perils of testing on one machine then submitting from another. missed it in one spot
  • Loading branch information
demonnic committed Feb 9, 2024
1 parent ec06df1 commit 1325533
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pilot/lib/pilot/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def fetch_app_platform(required: true)
result ||= FastlaneCore::IpaFileAnalyser.fetch_app_platform(config[:ipa]) if config[:ipa]
result ||= FastlaneCore::PkgFileAnalyser.fetch_app_platform(config[:pkg]) if config[:pkg]
if required
result ||= UI.input("Please enter the app's platform (appletvos, ios, osx): ")
UI.user_error!("App Platform must be ios, appletvos, or osx") unless ['ios', 'appletvos', 'osx'].include?(result)
result ||= UI.input("Please enter the app's platform (appletvos, ios, osx, xros): ")
UI.user_error!("App Platform must be ios, appletvos, osx, or xros") unless ['ios', 'appletvos', 'osx', 'xros'].include?(result)
UI.verbose("App Platform (#{result})")
end
return result
Expand Down
2 changes: 1 addition & 1 deletion pilot/lib/pilot/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.available_options
description: "The platform to use (optional)",
optional: true,
verify_block: proc do |value|
UI.user_error!("The platform can only be ios, appletvos, or osx") unless ['ios', 'appletvos', 'osx'].include?(value)
UI.user_error!("The platform can only be ios, appletvos, osx, or xros") unless ['ios', 'appletvos', 'osx', 'xros'].include?(value)
end),
FastlaneCore::ConfigItem.new(key: :apple_id,
short_option: "-p",
Expand Down
10 changes: 5 additions & 5 deletions pilot/spec/manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@
end

it "asks user to enter the app's platform manually" do
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx): ").and_return(fake_app_platform)
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx, xros): ").and_return(fake_app_platform)

fetch_app_platform_result = fake_manager.fetch_app_platform

Expand All @@ -542,7 +542,7 @@
end

it "asks user to enter the app's platform manually" do
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx): ").and_return(fake_app_platform)
expect(UI).to receive(:input).with("Please enter the app's platform (appletvos, ios, osx, xros): ").and_return(fake_app_platform)

fetch_app_platform_result = fake_manager.fetch_app_platform

Expand All @@ -566,7 +566,7 @@
end

it "does not ask user to enter the app's platform manually" do
expect(UI).not_to receive(:input).with("Please enter the app's platform (appletvos, ios, osx): ")
expect(UI).not_to receive(:input).with("Please enter the app's platform (appletvos, ios, osx, xros): ")

fetch_app_platform_result = fake_manager.fetch_app_platform(required: false)

Expand All @@ -589,12 +589,12 @@

allow(UI)
.to receive(:input)
.with("Please enter the app's platform (appletvos, ios, osx): ")
.with("Please enter the app's platform (appletvos, ios, osx, xros): ")
.and_return(invalid_app_platform)
end

it "raises the 'invalid platform' exception" do
expect(UI).to receive(:user_error!).with("App Platform must be ios, appletvos, or osx")
expect(UI).to receive(:user_error!).with("App Platform must be ios, appletvos, osx, or xros")

fake_manager.fetch_app_platform
end
Expand Down

0 comments on commit 1325533

Please sign in to comment.