Class: FastlaneCore::ShellScriptTransporterExecutor

Inherits:
TransporterExecutor show all
Defined in:
fastlane_core/lib/fastlane_core/itunes_transporter.rb

Overview

Generates commands and executes the iTMSTransporter through the shell script it provides by the same name

Instance Method Summary collapse

Methods inherited from TransporterExecutor

#execute

Instance Method Details

#build_download_command(username, password, apple_id, destination = "/tmp", provider_short_name = "") ⇒ Object



179
180
181
182
183
184
185
186
187
188
189
# File 'fastlane_core/lib/fastlane_core/itunes_transporter.rb', line 179

def build_download_command(username, password, apple_id, destination = "/tmp", provider_short_name = "")
  [
    '"' + Helper.transporter_path + '"',
    "-m lookupMetadata",
    "-u #{username.shellescape}",
    "-p #{shell_escaped_password(password)}",
    "-apple_id #{apple_id}",
    "-destination '#{destination}'",
    ("-itc_provider #{provider_short_name}" unless provider_short_name.to_s.empty?)
  ].compact.join(' ')
end

#build_provider_ids_command(username, password) ⇒ Object



191
192
193
194
195
196
197
198
# File 'fastlane_core/lib/fastlane_core/itunes_transporter.rb', line 191

def build_provider_ids_command(username, password)
  [
    '"' + Helper.transporter_path + '"',
    '-m provider',
    "-u \"#{username}\"",
    "-p #{shell_escaped_password(password)}"
  ].compact.join(' ')
end

#build_upload_command(username, password, source = "/tmp", provider_short_name = "") ⇒ Object



165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'fastlane_core/lib/fastlane_core/itunes_transporter.rb', line 165

def build_upload_command(username, password, source = "/tmp", provider_short_name = "")
  [
    '"' + Helper.transporter_path + '"',
    "-m upload",
    "-u #{username.shellescape}",
    "-p #{shell_escaped_password(password)}",
    "-f \"#{source}\"",
    additional_upload_parameters, # that's here, because the user might overwrite the -t option
    "-k 100000",
    ("-WONoPause true" if Helper.windows?), # Windows only: process instantly returns instead of waiting for key press
    ("-itc_provider #{provider_short_name}" unless provider_short_name.to_s.empty?)
  ].compact.join(' ')
end

#handle_error(password) ⇒ Object



200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'fastlane_core/lib/fastlane_core/itunes_transporter.rb', line 200

def handle_error(password)
  # rubocop:disable Style/CaseEquality
  # rubocop:disable Style/YodaCondition
  unless /^[0-9a-zA-Z\.\$\_\-]*$/ === password
    UI.error([
      "Password contains special characters, which may not be handled properly by iTMSTransporter.",
      "If you experience problems uploading to App Store Connect, please consider changing your password to something with only alphanumeric characters."
    ].join(' '))
  end
  # rubocop:enable Style/CaseEquality
  # rubocop:enable Style/YodaCondition

  UI.error("Could not download/upload from App Store Connect! It's probably related to your password or your internet connection.")
end