#! /bin/bash

#
# A simple script to create a Git tag. If no tag is supplied to it, it creates a one from the
# snapshot version.
#

# Get the directory from which this script is run
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# Test if a tag is passed to this script
if [ -z "$1" ]; then
  TAG=$($DIR/next_tag)
else
  TAG="$1"
fi

git tag -s "$TAG" -m "Tagging \"$TAG\" for release"

echo "Created new tag: $TAG"
