From 7d4c9b54e74c4261b6ccca3db5d3a5eaf4fbb885 Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Mon, 5 May 2014 16:16:51 +0200 Subject: [PATCH] bin/release: also check git tags for current version. Signed-off-by: Jacob Kiers --- bin/release | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/release b/bin/release index 7bb78d2..63262eb 100755 --- a/bin/release +++ b/bin/release @@ -45,6 +45,7 @@ fi jq_ver=$(find . -maxdepth 1 -name "*.jquery.json" | xargs cat | jq -r ".version") cmpnt_ver=$(find . -maxdepth 1 -name "bower.json" | xargs cat | jq -r ".version") pkg_ver=$(find . -maxdepth 1 -name "package.json" | xargs cat | jq -r ".version") +git_ver=$(git tag | sort -rV | head -n1) # Non npm package [ "$pkg_ver" == "0.0.0" ] && pkg_ver= @@ -54,6 +55,7 @@ current_ver= [ -n "$jq_ver" ] && current_ver="$jq_ver" [ -n "$cmpnt_ver" ] && current_ver="$cmpnt_ver" [ -n "$pkg_ver" ] && current_ver="$pkg_ver" +[ -n "$git_ver" ] && current_ver="$git_ver" [ -z "$current_ver" ] && current_ver="0.0.0" # Validate current versions and determine new version @@ -103,11 +105,11 @@ if [ -f src/Gruntfile.js ]; then fi # Commit changed files -git commit -am "v$new_ver" +git commit -am "$new_ver" git push origin # Create tag -git tag "v$new_ver" +git tag "$new_ver" git push origin --tags # Publish npm package