summaryrefslogtreecommitdiffstats
path: root/version.sh
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2014-09-15 20:50:43 -0400
committerwm4 <wm4@nowhere>2014-09-16 17:32:33 +0200
commit11c044aa48e4dc14c86cdf37591115a2590e48f8 (patch)
treecdc898f04fc41f6fd8791b123f4db717a5093bda /version.sh
parent45e2345a7f3e85c3e3c22944dda5fdb83c65ecc6 (diff)
downloadmpv-11c044aa48e4dc14c86cdf37591115a2590e48f8.tar.bz2
mpv-11c044aa48e4dc14c86cdf37591115a2590e48f8.tar.xz
TOOLS: shellcheck: quote variable expansions
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/version.sh b/version.sh
index 37802c6571..3eac7ef050 100755
--- a/version.sh
+++ b/version.sh
@@ -21,18 +21,18 @@ done
# Extract revision number from file used by daily tarball snapshots
# or from "git describe" output
git_revision=$(cat snapshot_version 2> /dev/null)
-test $git_revision || test ! -e .git || git_revision=$(git rev-parse --short HEAD)
-test $git_revision && git_revision=git-$git_revision
+test "$git_revision" || test ! -e .git || git_revision="$(git rev-parse --short HEAD)"
+test "$git_revision" && git_revision="git-$git_revision"
version="$git_revision"
# releases extract the version number from the VERSION file
-releaseversion=$(cat VERSION 2> /dev/null)
-if test $releaseversion ; then
- test $version && version="-$version"
+releaseversion="$(cat VERSION 2> /dev/null)"
+if test "$releaseversion" ; then
+ test "$version" && version="-$version"
version="$releaseversion$version"
fi
-test $version || version=UNKNOWN
+test "$version" || version=UNKNOWN
VERSION="${version}${extra}"