This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/scripts/version-get-string.sh

20 lines
499 B
Bash
Executable File

#!/bin/sh
# ensure packages are installed
if ! command -v git &> /dev/null; then
echo "Error: git is not installed. Please install git and try again."
exit 1
fi
# This script returns the new version string.
# It's built using the last semver git tag.
# For this
# - we use git describe (1).
# - remove the prefix 'v' (2)
# - remove the prefix 'g' from the current hash
get_version_string() {
git describe --tags --always --abbrev=10 | sed 's/^v//' | sed 's/-g/-/'
}
echo $(get_version_string)