Sha256: 8fb08311ea96fb87d25ccb30699d89c34eb40e7ede6e823226e989858f4ff98e

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby
require 'gli'
require 'rainbow'
require 'blast_off'

include GLI::App

program_desc 'An iOS beta distribution tool.'

version BlastOff::VERSION

desc 'Qiniu'
command :qiniu do |c|
  c.desc 'IPA file path'
  c.flag :ipa_file_path

  c.desc 'Access Key'
  c.flag :access_key

  c.desc 'Secret Key'
  c.flag :secret_key

  c.desc 'bucket'
  c.flag :bucket

  c.action do |global_options, options, args|
    help_now!('IPA file is required') unless options[:ipa_file_path]
    help_now!('Access Key is required') unless options[:access_key]
    help_now!('Secret Key is required') unless options[:secret_key]
    help_now!('Bucket is required') unless options[:bucket]

    url = BlastOff::Services::Qiniu.new(
      ipa_file_path: options[:ipa_file_path],
      access_key: options[:access_key],
      secret_key: options[:secret_key],
      bucket: options[:bucket]
    ).distribute
    puts url.foreground(:white).background(:blue)
  end
end

pre do |global,command,options,args|
  true
end

post do |global,command,options,args|
  # Post logic here
  # Use skips_post before a command to skip this
  # block on that command only
end

on_error do |exception|
  # Error logic here
  # return false to skip default error handling
  true
end

exit run(ARGV)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blast_off-0.5.0 bin/blast_off
blast_off-0.4.0 bin/blast_off
blast_off-0.3.0 bin/blast_off
blast_off-0.2.0 bin/blast_off