Skip to content
Browse files

Add check-repo script.

  • Loading branch information...
1 parent 4ebf0f7 commit ac45ea3567e564f4d4345a32827f0cc8db550d7c @mfs committed
Showing with 25 additions and 0 deletions.
  1. +25 −0 check-repo
View
25 check-repo
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+function print_usage
+{
+ echo "Usage: $0 <DIRECTORY>"
+ echo "Check git repo located in <DIRECTORY> for new remote tags."
+}
+
+if [[ $# != 1 ]]
+then
+ print_usage
+ exit 1
+fi
+
+cd $1
+
+TAG_PRE=$( git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tail -n 1)
+
+git fetch --quiet
+
+TAG_POST=$( git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tail -n 1)
+
+if [[ "$TAG_PRE" != "$TAG_POST" ]]; then
+ git show "$TAG_POST"
+fi

0 comments on commit ac45ea3

Please sign in to comment.
Something went wrong with that request. Please try again.