Skip to content

Commit

Permalink
Fix currentVersion regex always returning nil
Browse files Browse the repository at this point in the history
The pattern `[^$]+`failed to match any of the
string past "Current Version:", while `.+`
matches only the characters preceding the version
number.
  • Loading branch information
ericclemmons committed Aug 8, 2012
1 parent 8b10a12 commit 29aea42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/symfony2/doctrine.rb
Expand Up @@ -60,7 +60,7 @@
task :migrate, :roles => :app, :except => { :no_release => true } do
currentVersion = nil
run "cd #{latest_release} && #{php_bin} #{symfony_console} --no-ansi doctrine:migrations:status --env=#{symfony_env_prod}", :once => true do |ch, stream, out|
if stream == :out and out =~ /Current Version:[^$]+\(([\w]+)\)/
if stream == :out and out =~ /Current Version:.+\(([\w]+)\)/
currentVersion = Regexp.last_match(1)
end
if stream == :out and out =~ /Current Version:\s*0\s*$/
Expand Down

0 comments on commit 29aea42

Please sign in to comment.