Permalink
Browse files

extract code to copy_repository_to_local_cache

  • Loading branch information...
1 parent 8a12de6 commit bc310a7c9a8ac716b17b05a24dde7c1582967c2a @despo committed Mar 16, 2012
Showing with 12 additions and 8 deletions.
  1. +12 −8 lib/capistrano/recipes/deploy/strategy/copy.rb
View
20 lib/capistrano/recipes/deploy/strategy/copy.rb
@@ -55,14 +55,7 @@ class Copy < Base
# directory.
def deploy!
if copy_cache
- if File.exists?(copy_cache)
- refresh_local_cache
- else
- create_local_cache
- end
-
- raise_command_failed if last_command_failed?
-
+ copy_repository_to_local_cache
build(copy_cache)
copy_cache_to_server
else
@@ -184,6 +177,17 @@ def rollback_changes
FileUtils.rm filename rescue nil
FileUtils.rm_rf destination rescue nil
end
+
+ def copy_repository_to_local_cache
+ if File.exists?(copy_cache)
+ refresh_local_cache
+ else
+ create_local_cache
+ end
+
+ raise_command_failed if last_command_failed?
+ end
+
# Specify patterns to exclude from the copy. This is only valid
# when using a local cache.
def copy_exclude

0 comments on commit bc310a7

Please sign in to comment.