git_update/src/pre-push
2024-07-04 12:28:06 +02:00

17 lines
396 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Get package version
# TODO Add some well-known version provider mechanisms
version=""
[ -f package.json ] && version=$(npm pkg get version | tr -d '\"')
[ -f version ] && version=$(cat version)
[ -f VERSION ] && version=$(cat VERSION)
# Create semver tags
git tag -f v${version%.*.*}
git tag -f v${version%.*}
git tag -f v$version
# Push the tags
git push --no-verify --tags -f