Permalink
Browse files

Use current_path for memcached.php, and do not run unless we actually…

… have memcached servers specified
  • Loading branch information...
1 parent 3a9a4fb commit 561bff8002c319cddffe4cbf64a6fd33165a3308 @markjaquith committed Jun 5, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 Capistrano/lib/tasks.rb
View
@@ -36,9 +36,10 @@
end
desc "Updates the pool of memcached servers"
task :update do
- mc_servers = '<?php return array( "' + find_servers( :roles => :memcached ).join( ':11211", "' ) + ':11211" ); ?>'
- shared.make_shared_dir
- run "echo '#{mc_servers}' > #{release_path}/memcached.php", :roles => :memcached
+ unless find_servers( :roles => :memcached ).empty? then
+ mc_servers = '<?php return array( "' + find_servers( :roles => :memcached ).join( ':11211", "' ) + ':11211" ); ?>'
+ run "echo '#{mc_servers}' > #{current_path}/memcached.php", :roles => :memcached
+ end
end
end

0 comments on commit 561bff8

Please sign in to comment.