Sha256: 8f27455a04ed5356c21c252712b6b71bdb4d157daecf8aa0d92faedf683d3029

Contents?: true

Size: 865 Bytes

Versions: 11

Compression:

Stored size: 865 Bytes

Contents

require 'pe_build/archive'

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

  def execute

    options = {}

    parser = OptionParser.new do |o|
      o.banner = "Usage: vagrant pe-build download --version <version> --dir <dir>"
      o.separator ''

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

      o.on('-d', '--dir=val', String, 'The URL basedir containing the file') do |val|
        options[:dir] = val
      end
    end

    argv = parse_options(parser)
    filename = argv.last

    unless options[:version]
      raise Vagrant::Errors::CLIInvalidUsage, :help => parser.help.chomp
    end

    uri = URI.parse(options[:dir])

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

Version data entries

11 entries across 11 versions & 1 rubygems

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