Remove `config.package.extension` option. Use `config.package.name` instead.
This commit is contained in:
parent
9b6747713e
commit
1cbc60de1c
|
@ -44,6 +44,5 @@ Vagrant::Config.run do |config|
|
||||||
# config.vm.sync_script = "/tmp/sync"
|
# config.vm.sync_script = "/tmp/sync"
|
||||||
# config.vm.sync_crontab_entry_file = "/tmp/crontab-entry"
|
# config.vm.sync_crontab_entry_file = "/tmp/crontab-entry"
|
||||||
|
|
||||||
config.package.name = 'vagrant'
|
config.package.name = 'package.box'
|
||||||
config.package.extension = '.box'
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Vagrant
|
||||||
def initialize(app, env)
|
def initialize(app, env)
|
||||||
@app = app
|
@app = app
|
||||||
@env = env
|
@env = env
|
||||||
@env["package.output"] ||= "package"
|
@env["package.output"] ||= env["config"].package.name
|
||||||
@env["package.include"] ||= []
|
@env["package.include"] ||= []
|
||||||
|
|
||||||
env.error!(:box_file_exists, :output_file => tar_path) if File.exist?(tar_path)
|
env.error!(:box_file_exists, :output_file => tar_path) if File.exist?(tar_path)
|
||||||
|
@ -91,7 +91,7 @@ module Vagrant
|
||||||
|
|
||||||
# Path to the final box output file
|
# Path to the final box output file
|
||||||
def tar_path
|
def tar_path
|
||||||
File.join(FileUtils.pwd, "#{@env["package.output"]}#{@env.env.config.package.extension}")
|
File.join(FileUtils.pwd, @env["package.output"])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -192,7 +192,6 @@ module Vagrant
|
||||||
|
|
||||||
class PackageConfig < Base
|
class PackageConfig < Base
|
||||||
attr_accessor :name
|
attr_accessor :name
|
||||||
attr_accessor :extension
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class VagrantConfig < Base
|
class VagrantConfig < Base
|
||||||
|
|
|
@ -42,8 +42,7 @@ class Test::Unit::TestCase
|
||||||
config.vm.system = :linux
|
config.vm.system = :linux
|
||||||
config.vm.share_folder("v-root", "/vagrant", ".")
|
config.vm.share_folder("v-root", "/vagrant", ".")
|
||||||
|
|
||||||
config.package.name = 'vagrant'
|
config.package.name = 'package'
|
||||||
config.package.extension = '.box'
|
|
||||||
|
|
||||||
# Unison
|
# Unison
|
||||||
config.unison.folder_suffix = ".sync"
|
config.unison.folder_suffix = ".sync"
|
||||||
|
|
|
@ -31,9 +31,9 @@ class PackageVMActionTest < Test::Unit::TestCase
|
||||||
assert_equal :box_file_exists, @env.error.first
|
assert_equal :box_file_exists, @env.error.first
|
||||||
end
|
end
|
||||||
|
|
||||||
should "set the output path to 'package' by default" do
|
should "set the output path to configured by default" do
|
||||||
@klass.new(@app, @env)
|
@klass.new(@app, @env)
|
||||||
assert_equal "package", @env["package.output"]
|
assert_equal @env["config"].package.name, @env["package.output"]
|
||||||
end
|
end
|
||||||
|
|
||||||
should "not set the output path if it is already set" do
|
should "not set the output path if it is already set" do
|
||||||
|
@ -258,5 +258,10 @@ class PackageVMActionTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "tar path" do
|
||||||
|
should "return proper path" do
|
||||||
|
assert_equal File.join(FileUtils.pwd, @env["package.output"]), @instance.tar_path
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue