Class: Pindo::Command::Deploy::Pullconfig

Inherits:
Pindo::Command::Deploy show all
Defined in:
lib/pindo/command/deploy/pullconfig.rb

Constant Summary

Constants inherited from Pindo::Command

Pindo::Command::DEFAULT_OPTIONS, Pindo::Command::DEFAULT_ROOT_OPTIONS

Instance Attribute Summary

Attributes inherited from Pindo::Command

#args_help_flag

Instance Method Summary collapse

Methods inherited from Pindo::Command

options, run

Methods included from Funlog::Mixin

#pindo_log_instance

Methods included from Pindoconfig::Mixin

#pindo_single_config

Methods included from Githelper

#add_branch, #add_tag, #add_tag_with_check, #clone_clang_repo, #clone_devclang_repo, #clone_pindo_common_config_repo, #clone_pindo_env_config_repo, #clong_buildconfig_repo, #get_repo_base_name, #getcode_to_dir, #git_addpush_repo, #git_latest_commit_id, #local_branch_exists?, #local_tag_exists?, #prepare_gitenv, #process_need_add_files, #remote_branch_exists?, #remote_tag_exists?, #remove_branch, #remove_tag

Methods included from Executable

capture_command, #executable, execute_command, which, which!

Constructor Details

#initialize(argv) ⇒ Pullconfig

Returns a new instance of Pullconfig.



18
19
20
21
22
# File 'lib/pindo/command/deploy/pullconfig.rb', line 18

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

Instance Method Details

#runObject



34
35
36
37
38
39
40
41
# File 'lib/pindo/command/deploy/pullconfig.rb', line 34

def run
    
    app_config_dir = clong_buildconfig_repo(repo_name: @args_appconfig_repo_name) 
    current=Dir.pwd
    if !app_config_dir.eql?(current) && File.exist?(File.join(app_config_dir, 'config.json'))
        FileUtils.cp_r(File.join(app_config_dir, "config.json"), current)
    end
end

#validate!Object



24
25
26
27
28
29
30
31
32
# File 'lib/pindo/command/deploy/pullconfig.rb', line 24

def validate!
    super
            
    if @args_appconfig_repo_name.nil?
        say "You need input a bundle id"
        @args_appconfig_repo_name = ask('App Config Repo Name : ') || nil
    end
    help! 'You need input a repo name' if @args_appconfig_repo_name.nil? || @args_appconfig_repo_name.empty?
end