Sha256: f1b30dd4cf0dcc4108a7df08d1aba832f379686d0c5b1d899d44df28d5d5a6de

Contents?: true

Size: 813 Bytes

Versions: 10

Compression:

Stored size: 813 Bytes

Contents

require 'pe_build/archive'

class PEBuild::Command::Copy < Vagrant.plugin(2, :command)

  def initialize(argv, env)
    super
    @options = {}
  end

  def execute
    argv = parse_options(parser)

    filename = File.basename(argv.last)
    src_dir  = File.dirname(argv.last)

    archive = PEBuild::Archive.new(filename, @env)
    archive.version = @options[:version]

    uri = URI.parse src_dir
    archive.fetch(uri)

    @env.ui.info "pe-build: #{archive} has been added and is ready for use!", :prefix => true
  end

  private

  def parser
    OptionParser.new do |o|
      o.banner = "Usage: vagrant pe-build copy path/to/installer.tar.gz"
      o.separator ''

      o.on('-v', '--version=val', String, "The version of PE to fetch") do |val|
        options[:version] = val
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vagrant-pe_build-0.8.0 lib/pe_build/command/copy.rb
vagrant-pe_build-0.7.1 lib/pe_build/command/copy.rb
vagrant-pe_build-0.7.0 lib/pe_build/command/copy.rb
vagrant-pe_build-0.6.0 lib/pe_build/command/copy.rb
vagrant-pe_build-0.5.0 lib/pe_build/command/copy.rb
vagrant-pe_build-0.4.3 lib/pe_build/command/copy.rb
vagrant-pe_build-0.4.2 lib/pe_build/command/copy.rb
vagrant-pe_build-0.4.1 lib/pe_build/command/copy.rb
vagrant-pe_build-0.4.0 lib/pe_build/command/copy.rb
vagrant-pe_build-0.3.0 lib/pe_build/command/copy.rb