mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-28 19:33:09 +03:00
053fc0ff70
This reverts commit 9f98cf150a
.
30 lines
523 B
Bash
Executable File
30 lines
523 B
Bash
Executable File
#! /bin/sh
|
|
|
|
LC_ALL=C
|
|
export LC_ALL
|
|
|
|
srcdir="$(dirname "$0")"
|
|
test -z "$srcdir" && srcdir=.
|
|
|
|
cd "$srcdir"
|
|
|
|
if [ -f version ]; then
|
|
printf '%s' "$(cat version)"
|
|
exit 0
|
|
fi
|
|
|
|
if ! [ -d .git ] || ! git log -n1 --pretty='%h' >/dev/null 2>&1; then
|
|
printf 'UNVERSIONED'
|
|
exit 0
|
|
fi
|
|
|
|
tmpfile="$(mktemp)"
|
|
|
|
if ! git describe --exact-match --tags $(git log -n1 --pretty='%h') >"$tmpfile" 2>/dev/null; then
|
|
echo g$(git log -n1 --pretty='%h') >"$tmpfile"
|
|
fi
|
|
|
|
printf '%s' "$(sed 's/^v//g' <"$tmpfile")"
|
|
|
|
rm -f "$tmpfile"
|