Skip to content

Instantly share code, notes, and snippets.

@Ajnasz

Ajnasz/git-ver

Created Sep 29, 2019
Embed
What would you like to do?
#!/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