Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

extract code to copy_repository_to_local_cache

  • Loading branch information...
commit bc310a7c9a8ac716b17b05a24dde7c1582967c2a 1 parent 8a12de6
@despo authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.