Permalink
Browse files

Only try to lookup files and folders in the releases path on servers …

…that have code deployed
  • Loading branch information...
1 parent 7c8678d commit ae58a525cf17ae320024f72b2ae91ce689b9160f @cgriego committed Aug 20, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/capistrano/recipes/deploy.rb
@@ -51,13 +51,13 @@ def _cset(name, *args, &block)
_cset(:current_path) { File.join(deploy_to, current_dir) }
_cset(:release_path) { File.join(releases_path, release_name) }
-_cset(:releases) { capture("ls -x #{releases_path}").split.sort }
+_cset(:releases) { capture("ls -x #{releases_path}", :except => { :no_release => true }).split.sort }
_cset(:current_release) { File.join(releases_path, releases.last) }
_cset(:previous_release) { releases.length > 1 ? File.join(releases_path, releases[-2]) : nil }
-_cset(:current_revision) { capture("cat #{current_path}/REVISION").chomp }
-_cset(:latest_revision) { capture("cat #{current_release}/REVISION").chomp }
-_cset(:previous_revision) { capture("cat #{previous_release}/REVISION").chomp }
+_cset(:current_revision) { capture("cat #{current_path}/REVISION", :except => { :no_release => true }).chomp }
+_cset(:latest_revision) { capture("cat #{current_release}/REVISION", :except => { :no_release => true }).chomp }
+_cset(:previous_revision) { capture("cat #{previous_release}/REVISION", :except => { :no_release => true }).chomp if previous_release }
_cset(:run_method) { fetch(:use_sudo, true) ? :sudo : :run }

0 comments on commit ae58a52

Please sign in to comment.