diff --git a/lib/capistrano/rsync.rb b/lib/capistrano/rsync.rb index 758d96b..23238ff 100644 --- a/lib/capistrano/rsync.rb +++ b/lib/capistrano/rsync.rb @@ -33,7 +33,12 @@ rsync = %w[rsync] rsync.concat fetch(:rsync_options) rsync << fetch(:rsync_stage) + "/" - rsync << "#{user}#{role.hostname}:#{rsync_cache.call || release_path}" + + if role.hostname == 'localhost' + rsync << "#{rsync_cache.call || release_path}" + else + rsync << "#{user}#{role.hostname}:#{rsync_cache.call || release_path}" + end Kernel.system *rsync end