Sha256: 8c840544849415d5126681bbca4ce79cb365090e2d61e2e973d299afd0ffa8fa

Contents?: true

Size: 814 Bytes

Versions: 1

Compression:

Stored size: 814 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

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-pe_build-0.8.1 lib/pe_build/command/copy.rb