phd-thesis/manuscrit/bin/version.sh

12 lines
254 B
Bash
Raw Normal View History

2024-08-14 09:39:52 +02:00
#!/bin/bash
2024-08-14 09:48:53 +02:00
tag="$(git describe --tags --exact-match 2>/dev/null)"
if [ "$?" -eq 0 ] ; then
echo -n "$tag-"
fi
2024-08-14 09:39:52 +02:00
echo -n "$(git rev-parse --short HEAD)"
if [ -n "$(git status --porcelain --untracked-files=no)" ] ; then
echo -n "-dirty"
fi
echo ""