Create rgloader/loader.rb files for encoded files

This commit is contained in:
Mitchell Hashimoto 2013-01-31 18:48:56 -08:00
parent ab4046d8af
commit 67c2e205be
2 changed files with 15 additions and 1 deletions

View File

@ -490,7 +490,7 @@ module Vagrant
# Setup the list of child directories that need to be created if they
# don't already exist.
dirs = [@home_path]
subdirs = ["boxes", "data", "gems", "tmp"]
subdirs = ["boxes", "data", "gems", "rgloader", "tmp"]
dirs += subdirs.collect { |subdir| @home_path.join(subdir) }
# Go through each required directory, creating it if it doesn't exist
@ -514,6 +514,13 @@ module Vagrant
f.write("1.1")
end
end
# Create the rgloader/loader file so we can use encoded files.
loader_file = @home_path.join("rgloader", "loader.rb")
if !loader_file.file?
source_loader = Vagrant.source_root.join("templates/rgloader.rb")
FileUtils.cp(source_loader.to_s, loader_file.to_s)
end
end
# This creates the local data directory and show an error if it

7
templates/rgloader.rb Normal file
View File

@ -0,0 +1,7 @@
# This file loads the proper rgloader/loader.rb file that comes packaged
# with Vagrant so that encoded files can properly run with Vagrant.
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
require File.expand_path(
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
end