Class: Pindo::Command::Dev::Repoinit

Inherits:
Pindo::Command::Dev show all
Includes:
Githelper
Defined in:
lib/pindo/command/dev/repoinit.rb

Class Method Summary collapse

Instance Method Summary collapse

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, #git_root_directory, #is_git_directory?, #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) ⇒ Repoinit

Returns a new instance of Repoinit.



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/pindo/command/dev/repoinit.rb', line 37

def initialize(argv)
  @mode = argv.option('mode') || 'minor'
  @force_retag = argv.flag?('retag', false)
  
  unless ['major', 'minor', 'patch'].include?(@mode)
    raise Informative, "mode参数必须是 major, minor 或 patch"
  end
  
  super
  @additional_args = argv.remainder!
end

Class Method Details

.optionsObject



32
33
34
35
# File 'lib/pindo/command/dev/repoinit.rb', line 32

def self.options
  [
  ].concat(super)
end

Instance Method Details

#runObject



49
50
51
52
53
54
55
# File 'lib/pindo/command/dev/repoinit.rb', line 49

def run
  
  pindo_project_dir = Dir.pwd
  build_helper = Pindo::BuildHelper.share_instance
  build_helper.check_check_and_install_cliff(pindo_project_dir)

end