Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ appear at the top.

* Your contribution here!
* [#410](https://github.com/capistrano/sshkit/pull/410): call #to_s on remote so Pathnames don't go :boom: - [@UnderpantsGnome](https://github.com/UnderpantsGnome)
* [#411](https://github.com/capistrano/sshkit/pull/410): fix upload!/download! relative to user dir that broke in #408 - [@Fjan](https://github.com/Fjan)

## [1.15.0][] (2017-11-03)

Expand Down
4 changes: 2 additions & 2 deletions lib/sshkit/backends/local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(_ = nil, &block)
end

def upload!(local, remote, options = {})
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/")
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
if local.is_a?(String)
if options[:recursive]
FileUtils.cp_r(local, remote)
Expand All @@ -26,7 +26,7 @@ def upload!(local, remote, options = {})
end

def download!(remote, local=nil, _options = {})
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/")
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
if local.nil?
FileUtils.cp(remote, File.basename(remote))
else
Expand Down
4 changes: 2 additions & 2 deletions lib/sshkit/backends/netssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def assign_defaults

def upload!(local, remote, options = {})
summarizer = transfer_summarizer('Uploading', options)
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/")
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
with_ssh do |ssh|
ssh.scp.upload!(local, remote, options, &summarizer)
end
end

def download!(remote, local=nil, options = {})
summarizer = transfer_summarizer('Downloading', options)
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/")
remote = File.join(pwd_path, remote) unless remote.to_s.start_with?("/") || pwd_path.nil?
with_ssh do |ssh|
ssh.scp.download!(remote, local, options, &summarizer)
end
Expand Down