deliver/lib/deliver/commands_generator.rb in fastlane-2.29.0.beta.20170508010014 vs deliver/lib/deliver/commands_generator.rb in fastlane-2.29.0.beta.20170509010055
- old
+ new
@@ -26,10 +26,11 @@
end
return available_options
end
+ # rubocop:disable Metrics/PerceivedComplexity
def run
program :name, 'deliver'
program :version, Fastlane::VERSION
program :description, Deliver::DESCRIPTION
program :help, 'Author', 'Felix Krause <deliver@krausefx.com>'
@@ -48,11 +49,14 @@
FastlaneCore::CommanderGenerator.new.generate(deliverfile_options, command: c)
c.action do |args, options|
options = FastlaneCore::Configuration.create(deliverfile_options, options.__hash__)
loaded = options.load_configuration_file("Deliverfile")
- loaded = true if options[:description] || options[:ipa] || options[:pkg] # do we have *anything* here?
+
+ # Check if we already have a deliver setup in the current directory
+ loaded = true if options[:description] || options[:ipa] || options[:pkg]
+ loaded = true if File.exist?(File.join(FastlaneCore::FastlaneFolder.path || ".", "metadata"))
unless loaded
if UI.confirm("No deliver configuration found in the current directory. Do you want to setup deliver?")
require 'deliver/setup'
Deliver::Runner.new(options) # to login...
Deliver::Setup.new.run(options)
@@ -161,7 +165,8 @@
default_command :run
run!
end
+ # rubocop:enable Metrics/PerceivedComplexity
end
end