1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

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.
This commit is contained in:
Takumasa Ochi 2018-07-05 18:58:09 +09:00
parent 220db8faba
commit ad9c0a4555

View file

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