From b4bd63e1de3ad132b201c6f83fc00af4a5ef81de Mon Sep 17 00:00:00 2001 From: Edwin Pratomo Date: Thu, 27 Jul 2023 12:08:49 +0700 Subject: [PATCH] added conditional for local rsync --- lib/capistrano/rsync.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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