bitwarden_rs_ldap/scripts/check-version.sh
ViViDboarder 91d70e6bb8 Add linting, formatting and other checks
This adds pre-commit hooks installable using the provided Makefile as
well as a new check to validate the version in the Cargo file matches
the git tag. This will be useful as a check before pushing releases.
2020-07-09 12:09:19 -07:00

9 lines
290 B
Bash
Executable File

#! /bin/sh
CARGO_VERSION=$(cargo pkgid --offline | sed 's/.*#//')
GIT_VERSION=${GIT_VERSION:-$(git describe --tags --exact-match)}
if ! [ "v$CARGO_VERSION" = "$GIT_VERSION" ]; then
echo "ERROR: Cargo version (v$CARGO_VERSION) and git version ($GIT_VERSION) do not match"
exit 1
fi