Allow SSH upload to upload directories

This commit is contained in:
Mark Peek 2013-02-05 22:20:19 -08:00 committed by Mitchell Hashimoto
parent 87026b2d9e
commit 5f2c87d41d
1 changed files with 7 additions and 2 deletions

View File

@ -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