From ad9c0a455516426e3c634e9c9925b9cfd77d5108 Mon Sep 17 00:00:00 2001 From: Takumasa Ochi Date: Thu, 5 Jul 2018 18:58:09 +0900 Subject: [PATCH] Simplify code on removing old directories by skipping `Array#join` `execute(*)` provided by SSHKit internally joins arguments with space for the command to be executed. As it is the responsibility of SSHKit, we can skip the code at Capistrano layer. --- lib/capistrano/tasks/deploy.rake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/capistrano/tasks/deploy.rake b/lib/capistrano/tasks/deploy.rake index 5ff8c9a1..617c7bca 100644 --- a/lib/capistrano/tasks/deploy.rake +++ b/lib/capistrano/tasks/deploy.rake @@ -168,8 +168,7 @@ namespace :deploy do debug t(:no_current_release, host: host.to_s) end if directories.any? - directories_str = directories.join(" ") - execute :rm, "-rf", directories_str + execute :rm, "-rf", *directories else info t(:no_old_releases, host: host.to_s, keep_releases: fetch(:keep_releases)) end