Skip to content

Commit

Permalink
Re: capistrano#88, remove system inconsistencies using ls
Browse files Browse the repository at this point in the history
The fix committed in 92941e8 broke me, I think if there are really
inconsistencies between systems in how ls sorts, then we should simply
allow ruby to sort it.
  • Loading branch information
shame authored and leehambley committed Jan 4, 2010
1 parent c6a8f8f commit 8638f22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/capistrano/recipes/deploy.rb
Expand Up @@ -51,7 +51,9 @@ 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.reverse }
# re: https://capistrano.lighthouseapp.com/projects/8716/tickets/88-getting-the-newest-directory
# remove system inconsistencies with ls and let ruby sort the releases
_cset(:releases) { capture("ls -x #{releases_path}").split.sort }
_cset(:current_release) { File.join(releases_path, releases.last) }
_cset(:previous_release) { releases.length > 1 ? File.join(releases_path, releases[-2]) : nil }

Expand Down Expand Up @@ -386,6 +388,7 @@ def try_runner(*args)
else raise ArgumentError, "unknown migration target #{migrate_target.inspect}"
end

puts "#{migrate_target} => #{directory}"
run "cd #{directory}; #{rake} RAILS_ENV=#{rails_env} #{migrate_env} db:migrate"
end

Expand Down

0 comments on commit 8638f22

Please sign in to comment.