Class: Deliver::UploadAssets

Inherits:
Object
  • Object
show all
Defined in:
deliver/lib/deliver/upload_assets.rb

Constant Summary collapse

SUPPORTED_ICON_EXTENSIONS =
[".png", ".jpg", ".jpeg"]

Instance Method Summary collapse

Instance Method Details

#upload(options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'deliver/lib/deliver/upload_assets.rb', line 6

def upload(options)
  return unless options[:app_icon] || options[:apple_watch_app_icon]
  return if options[:edit_live]
  app = options[:app]

  v = app.edit_version(platform: options[:platform])
  UI.user_error!("Could not find a version to edit for app '#{app.name}'") unless v

  if options[:app_icon]
    UI.message("Uploading app icon...")
    v.upload_large_icon!(options[:app_icon])
  end

  if options[:apple_watch_app_icon]
    UI.message("Uploading apple watchapp icon...")
    v.upload_watch_icon!(options[:apple_watch_app_icon])
  end

  v.save!
end