218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
# File 'fastlane/lib/fastlane/runner.rb', line 218
def execute_action(method_sym, class_ref, arguments, custom_dir: nil, from_action: false)
if from_action == true
custom_dir = "." elsif custom_dir.nil?
custom_dir ||= "." if Helper.test?
custom_dir ||= ".."
end
verify_supported_os(method_sym, class_ref)
begin
Dir.chdir(custom_dir) do args = arguments.kind_of?(Array) && arguments.first.kind_of?(Hash) ? arguments.first : {}
step_name = args.delete(:step_name)
if arguments.count == 0
configurations = ConfigurationHelper.parse(class_ref, {}) elsif arguments.count == 1 && arguments.first.kind_of?(Hash)
configurations = ConfigurationHelper.parse(class_ref, arguments.first) elsif !class_ref.available_options
configurations = arguments
else
UI.user_error!("You have to call the integration like `#{method_sym}(key: \"value\")`. Run `fastlane action #{method_sym}` for all available keys. Please check out the current documentation on GitHub.")
end
unless from_action
action_name = step_name
action_name ||= class_ref.method(:step_text).arity == 1 ? class_ref.step_text(configurations) : class_ref.step_text
end
Actions.execute_action(action_name) do
if Fastlane::Actions.is_deprecated?(class_ref)
puts("==========================================".deprecated)
puts("This action (#{method_sym}) is deprecated".deprecated)
puts(class_ref.deprecated_notes.to_s.remove_markdown.deprecated) if class_ref.deprecated_notes
puts("==========================================\n".deprecated)
end
class_ref.runner = self return class_ref.run(configurations)
end
end
rescue Interrupt => e
raise e rescue FastlaneCore::Interface::FastlaneCommonException => e raise e
rescue FastlaneCore::Interface::FastlaneError => e action_completed(method_sym.to_s, status: FastlaneCore::ActionCompletionStatus::USER_ERROR, exception: e)
raise e
rescue Exception => e action_completed(method_sym.to_s, status: FastlaneCore::ActionCompletionStatus::FAILED, exception: e)
raise e
end
end
|