Permalink
Browse files

Fix shared_config:symlink when there aren't any shared_config.

  • Loading branch information...
1 parent 95f8b3a commit 4bb1af64b24a2f69268874e3ad6818a82f9dddca @technicalpickles technicalpickles committed Apr 3, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/moonshine/capistrano_integration.rb
@@ -313,11 +313,13 @@ def self.load_into(capistrano_config)
links << "ls #{latest_release}/#{file} 2> /dev/null || ln -nfs #{shared_path}/#{directory}/#{filename} #{latest_release}/#{file}"
end
-
- mkdir_command = "mkdir -p " + dirs.uniq.map {|dir| "'#{latest_release}/#{dir}'"}.join(" ")
- ln_commands = links.map {|l| "(#{l})"}.join(" && ")
-
- run "#{mkdir_command} && #{ln_commands}"
+
+ if (dirs + links).any?
+ mkdir_command = "mkdir -p " + dirs.uniq.map {|dir| "'#{latest_release}/#{dir}'"}.join(" ")
+ ln_commands = links.map {|l| "(#{l})"}.join(" && ")
+
+ run "#{mkdir_command} && #{ln_commands}"
+ end
end
end

0 comments on commit 4bb1af6

Please sign in to comment.