lib/deliver/commands_generator.rb in deliver-1.9.0 vs lib/deliver/commands_generator.rb in deliver-1.10.0
- old
+ new
@@ -4,11 +4,10 @@
HighLine.track_eof = false
module Deliver
class CommandsGenerator
include Commander::Methods
- UI = FastlaneCore::UI
def self.start
FastlaneCore::UpdateChecker.start_looking_for_update('deliver')
self.new.run
ensure
@@ -37,28 +36,38 @@
c.action do |args, options|
options = FastlaneCore::Configuration.create(Deliver::Options.available_options, options.__hash__)
loaded = options.load_configuration_file("Deliverfile")
loaded = true if options[:description] || options[:ipa] || options[:pkg] # do we have *anything* here?
unless loaded
- if agree("No deliver configuration found in the current directory. Do you want to setup deliver? (y/n)".yellow, true)
+ 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)
return 0
end
end
Deliver::Runner.new(options).run
end
end
-
+ command :submit_build do |c|
+ c.syntax = 'deliver submit_build'
+ c.description = 'Submit a specific build-nr for review, use latest for the latest build'
+ c.action do |args, options|
+ options = FastlaneCore::Configuration.create(Deliver::Options.available_options, options.__hash__)
+ options.load_configuration_file("Deliverfile")
+ options[:submit_for_review] = true
+ options[:build_number] = "latest" unless options[:build_number]
+ Deliver::Runner.new(options).run
+ end
+ end
command :init do |c|
c.syntax = 'deliver init'
c.description = 'Create the initial `deliver` configuration based on an existing app'
c.action do |args, options|
if File.exist?("Deliverfile") or File.exist?("fastlane/Deliverfile")
- Helper.log.info "You already got a running deliver setup in this directory".yellow
+ Ui.important("You already got a running deliver setup in this directory")
return 0
end
require 'deliver/setup'
options = FastlaneCore::Configuration.create(Deliver::Options.available_options, options.__hash__)
@@ -86,11 +95,11 @@
c.action do |args, options|
options = FastlaneCore::Configuration.create(Deliver::Options.available_options, options.__hash__)
options.load_configuration_file("Deliverfile")
Deliver::Runner.new(options) # to login...
- path = (FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.')
+ path = options[:screenshots_path] || (FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.')
Deliver::DownloadScreenshots.run(options, path)
end
end
command :download_metadata do |c|
@@ -99,12 +108,12 @@
c.action do |args, options|
options = FastlaneCore::Configuration.create(Deliver::Options.available_options, options.__hash__)
options.load_configuration_file("Deliverfile")
Deliver::Runner.new(options) # to login...
- path = (FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.')
+ path = options[:metadata_path] || (FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.')
res = ENV["DELIVER_FORCE_OVERWRITE"]
- res ||= agree("Do you want to overwrite existing metadata on path '#{File.expand_path(path)}/metadata'? (y/n)", true)
+ res ||= UI.confirm("Do you want to overwrite existing metadata on path '#{File.expand_path(path)}/metadata'?")
if res
require 'deliver/setup'
v = options[:app].latest_version
Deliver::Setup.new.generate_metadata_files(v, path)
else