Merge pull request #10279 from chrisroberts/e-local-encoded
Provide rgloader for project local plugins
This commit is contained in:
commit
a841a75a78
|
@ -906,6 +906,13 @@ module Vagrant
|
|||
begin
|
||||
@logger.debug("Creating: #{@local_data_path}")
|
||||
FileUtils.mkdir_p(@local_data_path)
|
||||
# Create the rgloader/loader file so we can use encoded files.
|
||||
loader_file = @local_data_path.join("rgloader", "loader.rb")
|
||||
if !loader_file.file?
|
||||
source_loader = Vagrant.source_root.join("templates/rgloader.rb")
|
||||
FileUtils.mkdir_p(@local_data_path.join("rgloader").to_s)
|
||||
FileUtils.cp(source_loader.to_s, loader_file.to_s)
|
||||
end
|
||||
rescue Errno::EACCES
|
||||
raise Errors::LocalDataDirectoryNotAccessible,
|
||||
local_data_path: @local_data_path.to_s
|
||||
|
|
|
@ -1513,4 +1513,21 @@ VF
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#setup_local_data_path" do
|
||||
before do
|
||||
allow(FileUtils).to receive(:mkdir_p).and_call_original
|
||||
allow(FileUtils).to receive(:cp).and_call_original
|
||||
end
|
||||
|
||||
it "should create an rgloader path" do
|
||||
expect(FileUtils).to receive(:mkdir_p).with(/(?!home)rgloader/)
|
||||
instance
|
||||
end
|
||||
|
||||
it "should write the rgloader file" do
|
||||
expect(FileUtils).to receive(:cp).with(anything, /(?!home)rgloader.*rb$/)
|
||||
instance
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue