Permalink
Browse files

Merge pull request #123 from yyyc514/master

Speed up deploys by issuing fewer commands
  • Loading branch information...
technicalpickles committed Mar 30, 2012
2 parents 5d29398 + 9fb15ff commit 107d49a50527b65d0a2a51cf151184c709aa9815
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/moonshine/capistrano_integration.rb
@@ -303,15 +303,18 @@ def self.load_into(capistrano_config)
Symlinks uploaded local configurations into the release directory.
DESC
task :symlink do
+ dirs, links = [], []
fetch(:shared_config).each do |file|
file = Pathname.new(file)
filename = file.basename
directory = file.dirname
+ dirs << directory
- run "mkdir -p '#{latest_release}/#{directory}'"
- run "ls #{latest_release}/#{file} 2> /dev/null || ln -nfs #{shared_path}/#{directory}/#{filename} #{latest_release}/#{file}"
+ links << "ls #{latest_release}/#{file} 2> /dev/null || ln -nfs #{shared_path}/#{directory}/#{filename} #{latest_release}/#{file}"
end
+ run "mkdir -p " + dirs.uniq.map {|dir| "'#{latest_release}/#{dir}'"}.join(" ")
+ run links.map {|l| "(#{l})"}.join(" && ")
end
end

0 comments on commit 107d49a

Please sign in to comment.