lib/demonz/common.rb in capistrano-demonz-0.0.22 vs lib/demonz/common.rb in capistrano-demonz-0.0.23

- old
+ new

@@ -54,11 +54,18 @@ # Remove release if it exists release_history.delete_at release_history.index(release) unless release_history.index(release).nil? # Save - release_history = release_history.join("\n") - try_sudo "printf \"#{release_history}\" > #{release_file}" + first_rel = true + release_history.each do |rel| + if first_rel + try_sudo "echo '#{rel}' > #{release_file}" + first_rel = false + else + try_sudo "echo '#{rel}' >> #{release_file}" + end + end end # Get the database name given an application and release name def get_db_name(application, release) # Match possible db username (max 16 chars) and,