Permalink
Browse files

Remove redundant condition check in copy strategy.

  • Loading branch information...
1 parent 7120c4a commit a4fc630027dccd6ee160cdbba026357138fbd046 @maxim maxim committed Aug 23, 2011
Showing with 6 additions and 7 deletions.
  1. +6 −7 lib/capistrano/recipes/deploy/strategy/copy.rb
@@ -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

0 comments on commit a4fc630

Please sign in to comment.