Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…that have code deployed
  • Loading branch information...
commit ae58a525cf17ae320024f72b2ae91ce689b9160f 1 parent 7c8678d
@cgriego authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/capistrano/recipes/deploy.rb
View
8 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 }
Please sign in to comment.
Something went wrong with that request. Please try again.