Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Created September 29, 2019 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ajnasz/156c3b444074af4e19f7fa2b00c08b97 to your computer and use it in GitHub Desktop.
Save Ajnasz/156c3b444074af4e19f7fa2b00c08b97 to your computer and use it in GitHub Desktop.
#!/bin/sh
VERSION="$1"
if [ -z "$VERSION" ];then
echo "Version argument is mandantory" >&2
exit 1
fi
if expr "$VERSION" : "^v[0-9]\+\.[0-9]\+\.[0-9]\+" >/dev/null;then
git commit --allow-empty -m "$VERSION"
git tag $VERSION
else
echo "Not a valid version" >&2
exit 2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment