Class: VPL::Command::Publish

Inherits:
VPL::Command show all
Defined in:
lib/vcpkg_pipeline/command/publish.rb

Overview

VPL::Command::Publish

Instance Attribute Summary

Attributes inherited from VPL::Command

#argv_extension

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from VPL::Command

ensure_not_root_or_allowed!, git_version, options_extension, run, verify_minimum_git_version!, verify_xcode_license_approved!

Constructor Details

#initialize(argv) ⇒ Publish

Returns a new instance of Publish.



34
35
36
37
38
39
# File 'lib/vcpkg_pipeline/command/publish.rb', line 34

def initialize(argv)
  @path = argv.shift_argument || Dir.pwd

  @reg = argv.option('reg', '').split(',').first
  super
end

Class Method Details

.optionsObject



22
23
24
25
26
# File 'lib/vcpkg_pipeline/command/publish.rb', line 22

def self.options
  [
    ['--reg=.', '指定vcpkg的reg目录, 不可为空']
  ].concat(super).concat(options_extension)
end

.options_extension_hashObject



28
29
30
31
32
# File 'lib/vcpkg_pipeline/command/publish.rb', line 28

def self.options_extension_hash
  Hash[
    'update' => Update::All.options,
  ]
end

Instance Method Details

#runObject



41
42
43
44
45
46
47
48
49
50
# File 'lib/vcpkg_pipeline/command/publish.rb', line 41

def run
  VPL.error("reg目录异常: #{@reg}") unless File.directory? @reg

  Update::All.run([@path] + argv_extension['update'])

  scanner = Scanner.new(@path)

  vcpkg = VCPkg.open(@reg)
  vcpkg.publish(scanner.vcport)
end