Sha256: 3a72e5db9e12c3b5d9db639e59e21f7b39bb4d5286476a891e8767bb4ff8e84c

Contents?: true

Size: 971 Bytes

Versions: 2

Compression:

Stored size: 971 Bytes

Contents

module Fir
  class Cli < Thor
    desc 'batpub FOLDER_1, FOLDER_2, ...', '批量上传指定文件夹中的全部文件'
    option :resign, :aliases => '-r', :desc => '是否以企业签名发布', :type => :boolean
    option :token, :aliases => '-t', :desc => '用户令牌'
    option :email, :aliases => '-e', :desc => '邮件地址'
    option :verbose, :aliases => '-v', :desc => '设置输出级别 v, vv, vvv'
    option :quiet, :aliases => '-q', :desc => '安静模式,不输出任何选项'
    def batpub(*dirs)
      puts "! #{ Paint['至少需要输入提供一个文件夹', :red] }" if dirs.length == 0
      dirs.each do |dir|
        Dir.foreach(dir) do |f|
          if _is_ipa(f) || _is_apk(f)
            _puts "> 正在发布 #{ f }"
            begin
              publish File.join dir, f
            rescue Exception => e
              _puts "! #{ f } 失败:#{ e.to_s }"
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fir-cli-batch-0.0.2 lib/fir-cli-commands/batpub.rb
fir-cli-batch-0.0.1 lib/fir-cli-commands/batpub.rb