Class: Pindo::Command::Appstore::Quswauth

Inherits:
Pindo::Command::Appstore show all
Defined in:
lib/pindo/command/appstore/quswauth.rb

Constant Summary

Constants inherited from Pindo::Command

DEFAULT_OPTIONS, DEFAULT_ROOT_OPTIONS

Instance Attribute Summary

Attributes inherited from Pindo::Command

#args_help_flag

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pindo::Command

command_name, #initialize_options, run, use_cache?, #validate!

Methods included from Funlog::Mixin

#pindo_log_instance

Methods included from Pindoconfig::Mixin

#pindo_single_config

Constructor Details

#initialize(argv) ⇒ Quswauth

Returns a new instance of Quswauth.



36
37
38
39
# File 'lib/pindo/command/appstore/quswauth.rb', line 36

def initialize(argv)
    super
    @additional_args = argv.remainder!
end

Class Method Details

.optionsObject



30
31
32
33
34
# File 'lib/pindo/command/appstore/quswauth.rb', line 30

def self.options
    [

    ].concat(super)
end

Instance Method Details

#runObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/pindo/command/appstore/quswauth.rb', line 41

def run


    project_dir = Dir.pwd
    config_file = File.join(project_dir, "config.json")

    # 加载配置
    config_parser = Pindo::IosConfigParser.instance
    config_parser.load_config(config_file: config_file)

    bundle_id = config_parser.bundle_id
    if bundle_id.nil? || bundle_id.empty?
        raise Informative, "无法从配置文件中获取 Bundle ID"
    end

    # 调用封装的方法
    success = Pindo::XcodeSwarkHelper.swark_authorize_run(bundle_id: bundle_id)

    unless success
        raise Informative, "Swark 授权失败,请检查日志"
    end
end