Skip to content
This repository was archived by the owner on Nov 19, 2018. It is now read-only.

Commit c00cb10

Browse files
committed
Added support for apps, not yet publicly available
1 parent 8492a29 commit c00cb10

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

lib/assets/DeliverfileDefault

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ email '[[EMAIL]]'
99

1010
# The app identifier is required
1111
app_identifier "[[APP_IDENTIFIER]]"
12+
apple_id "[[APPLE_ID]]"
1213

1314

1415
# This folder has to include one folder for each language

lib/deliver/app.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,15 @@ def initialize(apple_id: nil, app_identifier: nil)
4343
begin
4444
self.apple_id = Deliver::ItunesSearchApi.fetch_by_identifier(app_identifier)['trackId']
4545
rescue
46-
Helper.log.fatal "Could not find Apple ID based on the app identifier '#{app_identifier}'. Maybe the app is not in the AppStore yet?"
47-
raise "Please pass a valid Apple ID using 'apple_id'".red
46+
unless Helper.is_test?
47+
Helper.log.info "Could not find Apple ID based on the app identifier in the US App Store. Maybe the app is not yet in the store?".yellow
48+
49+
while ((self.apple_id || '').to_s.length == 0) || ((self.apple_id || 0).to_i == 0)
50+
self.apple_id = ask("\nApple ID of your app (e.g. 284882215): ")
51+
end
52+
else
53+
raise "Please pass a valid Apple ID using 'apple_id'".red
54+
end
4855
end
4956
end
5057
end

lib/deliver/deliverfile/deliverfile_creator.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def self.generate_deliver_file(app, path, project_name)
8686
deliver = File.read("#{gem_path}/lib/assets/DeliverfileDefault")
8787
deliver.gsub!("[[APP_IDENTIFIER]]", app.app_identifier)
8888
deliver.gsub!("[[APP_NAME]]", project_name)
89+
deliver.gsub!("[[APPLE_ID]]", app.apple_id.to_s)
8990
deliver.gsub!("[[EMAIL]]", PasswordManager.shared_manager.username)
9091

9192
return deliver

spec/deliverfile_creator_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
correct.gsub!("[[APP_IDENTIFIER]]", 'net.sunapps.54')
6161
correct.gsub!("[[APP_NAME]]", project_name)
6262
correct.gsub!("[[EMAIL]]", ENV["DELIVER_USER"])
63+
correct.gsub!("[[APPLE_ID]]", apple_id.to_s)
6364
expect(File.read("/tmp/Deliverfile")).to eq(correct)
6465

6566
expect(File.directory?([deliver_path, "screenshots"].join("/"))).to eq(true)

0 commit comments

Comments
 (0)