summaryrefslogtreecommitdiff
path: root/resources/scripts/misc/versioncheck
diff options
context:
space:
mode:
Diffstat (limited to 'resources/scripts/misc/versioncheck')
-rwxr-xr-xresources/scripts/misc/versioncheck18
1 files changed, 7 insertions, 11 deletions
diff --git a/resources/scripts/misc/versioncheck b/resources/scripts/misc/versioncheck
index 3118e297..01e69231 100755
--- a/resources/scripts/misc/versioncheck
+++ b/resources/scripts/misc/versioncheck
@@ -20,24 +20,20 @@
set -u -e
version="version-unknown"
-if [ -f version ]; then
- version="$(cat version)"
-fi
+[ -f version ] && version="$(cat version)"
version_="${version}"
if [ -e ".git" ]; then
- version="$(git describe --tags HEAD 2>&1)" \
- || version="git-$(git rev-parse HEAD 2>&1)" \
- || version="${version_}"
+ version="$(git describe --tags HEAD 2>&1)" || \
+ version="git-$(git rev-parse HEAD 2>&1)" || \
+ version="${version_}"
printf "%s\n" "${version}" > version
fi
versiondate="version-date-unknown"
-if [ -f versiondate ]; then
- versiondate="$(cat versiondate)"
-fi
+[ -f versiondate ] && versiondate="$(cat versiondate)"
versiondate_="${versiondate}"
if [ -e ".git" ]; then
- versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" \
- || versiondate="${versiondate_}"
+ versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" || \
+ versiondate="${versiondate_}"
printf "%s\n" "${versiondate}" > versiondate
fi