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 'optparse'
require "pathname"
module VagrantPlugins
module CommandBox
module Command
class Repackage < Vagrant.plugin("2", :command)
def execute
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant box repackage <name> <provider>"
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant box repackage <name> <provider>"
end
# Parse the options
@ -32,7 +31,7 @@ module VagrantPlugins
raise Vagrant::Errors::BoxNotFound, :name => box_name if !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)
# Success, exit status 0