From: Don March Date: Sat, 26 Mar 2016 18:12:07 +0000 (-0400) Subject: Fix git version parsing when there are spaces X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/6909ac8d1d9df4544d5f0584682d37e43ed354d9?hp=8ae70a31cd3553ea94502b9784ba4dc5bee274c4 Fix git version parsing when there are spaces --- diff --git a/vcsh b/vcsh index f9bea25..de1b419 100755 --- a/vcsh +++ b/vcsh @@ -476,7 +476,7 @@ write_gitignore() { use cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11 - local GIT_VERSION=$(git --version) + local GIT_VERSION="$(git --version)" local GIT_VERSION_MAJOR=$(echo $GIT_VERSION | sed -n 's/.* \([0-9]\)\..*/\1/p') local GIT_VERSION_MINOR=$(echo $GIT_VERSION | sed -n 's/.* \([0-9]\)\.\([0-9]\)\..*/\2/p') OLDIFS=$IFS