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

Commit

Permalink
Added support for apps, not yet publicly available
Browse files Browse the repository at this point in the history
  • Loading branch information
KrauseFx committed Nov 7, 2014
1 parent 8492a29 commit c00cb10
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/assets/DeliverfileDefault
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ email '[[EMAIL]]'

# The app identifier is required
app_identifier "[[APP_IDENTIFIER]]"
apple_id "[[APPLE_ID]]"


# This folder has to include one folder for each language
Expand Down
11 changes: 9 additions & 2 deletions lib/deliver/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ def initialize(apple_id: nil, app_identifier: nil)
begin
self.apple_id = Deliver::ItunesSearchApi.fetch_by_identifier(app_identifier)['trackId']
rescue
Helper.log.fatal "Could not find Apple ID based on the app identifier '#{app_identifier}'. Maybe the app is not in the AppStore yet?"
raise "Please pass a valid Apple ID using 'apple_id'".red
unless Helper.is_test?
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

while ((self.apple_id || '').to_s.length == 0) || ((self.apple_id || 0).to_i == 0)
self.apple_id = ask("\nApple ID of your app (e.g. 284882215): ")
end
else
raise "Please pass a valid Apple ID using 'apple_id'".red
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/deliver/deliverfile/deliverfile_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def self.generate_deliver_file(app, path, project_name)
deliver = File.read("#{gem_path}/lib/assets/DeliverfileDefault")
deliver.gsub!("[[APP_IDENTIFIER]]", app.app_identifier)
deliver.gsub!("[[APP_NAME]]", project_name)
deliver.gsub!("[[APPLE_ID]]", app.apple_id.to_s)
deliver.gsub!("[[EMAIL]]", PasswordManager.shared_manager.username)

return deliver
Expand Down
1 change: 1 addition & 0 deletions spec/deliverfile_creator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
correct.gsub!("[[APP_IDENTIFIER]]", 'net.sunapps.54')
correct.gsub!("[[APP_NAME]]", project_name)
correct.gsub!("[[EMAIL]]", ENV["DELIVER_USER"])
correct.gsub!("[[APPLE_ID]]", apple_id.to_s)
expect(File.read("/tmp/Deliverfile")).to eq(correct)

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

0 comments on commit c00cb10

Please sign in to comment.