diff --git a/scripts/version b/scripts/version index b92f862..16d8266 100755 --- a/scripts/version +++ b/scripts/version @@ -7,8 +7,7 @@ if [ $(git describe --tags --exact-match --match 'v[0-9]*.[0-9]*.[0-9]*' &>/dev/ version=$(git describe --tags --exact-match --match 'v[0-9]*.[0-9]*.[0-9]*') fi -if [ $(expr match "${version}" '^v') -eq 1 ]; then - printf '%s\n' $(expr substr "${version}" 2 $(expr length "${version}")) -else - printf '%s\n' "${version}" -fi +case "$version" in + v*) echo "${version#v}" ;; + *) echo "$version" ;; +esac