lib/phase/cli/ipa.rb in phase-0.0.13 vs lib/phase/cli/ipa.rb in phase-0.0.14

- old
+ new

@@ -1,18 +1,21 @@ module Phase module CLI class IPA < Command command :ipa do |c| - c.syntax = "phase ipa [version_number] [filename|glob_pattern]..." + c.syntax = "phase ipa [-e environment] version_number filename|glob_pattern..." + c.option "-e", "--environment name", String, "Uploads files for 'production' or 'staging' (default is 'staging')." + c.description = <<-EOS.strip_heredoc Generates enterprise distribution .plists for .ipa app bundles and uploads all required files to the web for distribution. EOS c.action do |args, options| + options.default environment: "staging" new(args, options).run end end attr_accessor :version, :filenames @@ -20,11 +23,11 @@ def initialize(args, options) @version = args.shift @filenames = args if @version.blank? || @filenames.blank? - fail "invalid syntax: phase ipa [version_number] [filename|glob_pattern]..." + fail "invalid syntax: phase ipa [-e environment] version_number filename|glob_pattern..." end if Phase.config.ipa.bundle_id_prefix.blank? fail "missing setting: set `Phase.config.ipa.bundle_id_prefix = [PREFIX] in Phasefile" elsif Phase.config.ipa.bucket_name.blank? @@ -35,10 +38,10 @@ super end def run - deployment = ::Phase::IPA::EnterpriseDeployment.new(version, *filenames) + deployment = ::Phase::IPA::EnterpriseDeployment.new(options.environment, version, *filenames) deployment.run! end end end