Add a provisioner which will upload host files and directories to the guest via the scp channel. This is useful for populating user specific files into the guest. This is a rename from scpupload to file and updated against master. [GH-1357]
17 lines
458 B
Ruby
17 lines
458 B
Ruby
module VagrantPlugins
|
|
module FileUpload
|
|
class Provisioner < Vagrant.plugin("2", :provisioner)
|
|
def provision
|
|
@machine.communicate.tap do |comm|
|
|
# Make sure the remote path exists
|
|
command = "mkdir -p %s" % File.dirname(config.destination)
|
|
comm.execute(command)
|
|
|
|
# now upload the file
|
|
comm.upload(File.expand_path(config.source), config.destination)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|