lib/demonz/drupal.rb in capistrano-demonz-0.0.10 vs lib/demonz/drupal.rb in capistrano-demonz-0.0.11
- old
+ new
@@ -80,13 +80,15 @@
# If no release specified, use latest.
if removed_release.nil?
logger.important "no release specified, using latest release instead"
removed_release = releases.last
+ end
+ if removed_release == releases.last
# Keep track of some extra variables for this special case.
delete_latest = true
- prior_release = releases[-2]
+ prior_release = releases.length > 1 ? releases[-2] : nil
end
# Prevent heart attacks.
confirm_deletion = text_prompt("About to delete release '#{removed_release}', continue? (Y/n) ").downcase
raise Capistrano::Error, "User unsure, exiting." if confirm_deletion != 'y'