Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Warn when a release newer than the given version already exists.

  • Loading branch information...
commit e32079e6d61af4cc4ae51c7b06fcc2a6f3942f80 1 parent deab289
@benhoskings authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 deps/release.rb
View
9 deps/release.rb
@@ -16,6 +16,11 @@ def latest_tag
dep 'release', :version, :version_file, :template => 'release' do
requires 'release exists'.with(version, version_file)
+ setup {
+ if latest_tag > release_tag
+ log_warn "There is already a newer release than #{release_tag} (#{latest_tag})."
+ end
+ }
met? {
shell("git ls-remote --tags origin").split("\n").grep(%r{refs/tags/#{release_tag}$}).any?
}
@@ -38,7 +43,7 @@ def update_version!
end
requires 'repo on master'
- requires_when_unmet 'repo clean', 'latest tag in history', 'build passing'
+ requires_when_unmet 'repo clean', 'descendant of last release', 'build passing'
met? {
repo.resolve(release_tag)
@@ -73,7 +78,7 @@ def update_version!
}
end
-dep 'latest tag in history', :template => 'release' do
+dep 'descendant of last release', :template => 'release' do
met? {
if shell?("git rev-list HEAD | grep #{repo.resolve(latest_tag)}")
log_ok "The most recent version (#{latest_tag} / #{repo.resolve(latest_tag)}) is a parent of HEAD."
Please sign in to comment.
Something went wrong with that request. Please try again.