Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
Use more specific tag matching.
Browse files Browse the repository at this point in the history
  • Loading branch information
liveh2o committed Jul 25, 2013
1 parent bb3d183 commit 63a03de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/capistrano/detect_migrations.rb
Expand Up @@ -4,13 +4,13 @@ module Capistrano
module DetectMigrations

def last_git_tag_for(stage)
`git tag -l #{stage}-[0-9]*`.split(/\n/).last
`git tag -l #{stage}-[0-9]*.[0-9]*.[0-9]*[-_][0-9]*`.split(/\n/).last
end

def pending_migrations?
!(`git diff --shortstat #{last_git_tag_for(stage)} #{branch} db/migrate`.strip.empty?)
end

def show_pending_migrations
cdt.safe_run 'git', 'diff', '--summary', '--color', last_git_tag_for(stage), branch, 'db/migrate'
end
Expand All @@ -30,7 +30,7 @@ def self.load_into(configuration)
if cdm.pending_migrations?
logger.log Logger::IMPORTANT, "Pending migrations!!!"
cdm.show_pending_migrations

$stdout.puts "Do you want to continue deployment? (Y/N)"
unless cdm.approved?
logger.log Logger::IMPORTANT, "Aborting deployment!"
Expand Down

0 comments on commit 63a03de

Please sign in to comment.