Skip to content

Commit

Permalink
Remove redundant condition check in copy strategy.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim committed Aug 23, 2011
1 parent 7120c4a commit a4fc630
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/capistrano/recipes/deploy/strategy/copy.rb
Expand Up @@ -86,13 +86,12 @@ def deploy!

if copy_exclude.any?
logger.debug "processing exclusions..."
if copy_exclude.any?
copy_exclude.each do |pattern|
delete_list = Dir.glob(File.join(destination, pattern), File::FNM_DOTMATCH)
# avoid the /.. trap that deletes the parent directories
delete_list.delete_if { |dir| dir =~ /\/\.\.$/ }
FileUtils.rm_rf(delete_list.compact)
end

copy_exclude.each do |pattern|
delete_list = Dir.glob(File.join(destination, pattern), File::FNM_DOTMATCH)
# avoid the /.. trap that deletes the parent directories
delete_list.delete_if { |dir| dir =~ /\/\.\.$/ }
FileUtils.rm_rf(delete_list.compact)
end
end
end
Expand Down

0 comments on commit a4fc630

Please sign in to comment.