Allow SSH upload to upload directories
This commit is contained in:
parent
87026b2d9e
commit
5f2c87d41d
|
@ -97,8 +97,13 @@ module VagrantPlugins
|
||||||
@logger.debug("Uploading: #{from} to #{to}")
|
@logger.debug("Uploading: #{from} to #{to}")
|
||||||
|
|
||||||
scp_connect do |scp|
|
scp_connect do |scp|
|
||||||
# Open file read only to fix issue [GH-1036]
|
if File.directory?(from)
|
||||||
scp.upload!(File.open(from, "r"), to)
|
# Recurisvely upload directories
|
||||||
|
scp.upload!(from, to, :recursive => true)
|
||||||
|
else
|
||||||
|
# Open file read only to fix issue [GH-1036]
|
||||||
|
scp.upload!(File.open(from, "r"), to)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
rescue RuntimeError => e
|
rescue RuntimeError => e
|
||||||
# Net::SCP raises a runtime error for this so the only way we have
|
# Net::SCP raises a runtime error for this so the only way we have
|
||||||
|
|
Loading…
Reference in New Issue