Fix repackage command to actually work properly

This commit is contained in:
Mitchell Hashimoto 2013-01-28 13:06:13 -08:00
parent e6a0023713
commit 2d2f9577af
1 changed files with 4 additions and 5 deletions

View File

@ -1,15 +1,14 @@
require "fileutils" require "fileutils"
require 'optparse' require 'optparse'
require "pathname"
module VagrantPlugins module VagrantPlugins
module CommandBox module CommandBox
module Command module Command
class Repackage < Vagrant.plugin("2", :command) class Repackage < Vagrant.plugin("2", :command)
def execute def execute
options = {} opts = OptionParser.new do |o|
o.banner = "Usage: vagrant box repackage <name> <provider>"
opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant box repackage <name> <provider>"
end end
# Parse the options # Parse the options
@ -32,7 +31,7 @@ module VagrantPlugins
raise Vagrant::Errors::BoxNotFound, :name => box_name if !box raise Vagrant::Errors::BoxNotFound, :name => box_name if !box
# Repackage the box # Repackage the box
output_path = File.expand_path(@env.config.global.package.name, FileUtils.pwd) output_path = Pathname.new(File.expand_path(@env.config_global.package.name, FileUtils.pwd))
box.repackage(output_path) box.repackage(output_path)
# Success, exit status 0 # Success, exit status 0