Require Vagrant code right on the beginning of base box building process so it fails early

This commit is contained in:
Fabio Rehm 2013-07-08 10:47:07 -03:00
parent 44bedfe7c6
commit e10822df32

View file

@ -4,6 +4,8 @@ load 'tasks/boxes.v2.rake'
class BuildGenericBoxTaskV3 < BuildGenericBoxTaskV2 class BuildGenericBoxTaskV3 < BuildGenericBoxTaskV2
def build def build
require 'vagrant'
check_if_box_has_been_built! check_if_box_has_been_built!
FileUtils.mkdir_p 'boxes/temp' unless File.exist? 'base/temp' FileUtils.mkdir_p 'boxes/temp' unless File.exist? 'base/temp'
@ -26,7 +28,6 @@ class BuildGenericBoxTaskV3 < BuildGenericBoxTaskV2
end end
def finalize def finalize
require 'vagrant'
auth_key = Vagrant.source_root.join('keys', 'vagrant.pub').expand_path.to_s auth_key = Vagrant.source_root.join('keys', 'vagrant.pub').expand_path.to_s
run 'finalize', @arch, @release, auth_key run 'finalize', @arch, @release, auth_key
end end