diff options
-rwxr-xr-x | git-prompt.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/git-prompt.sh b/git-prompt.sh index 50ef573..d8d6e2f 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -165,7 +165,12 @@ cwd_truncate() { return ;; *) - local cwd_max_length=$1 + if [[ ${BASH_VERSINFO[0]} -ge 3 && ${BASH_VERSINFO[1]} -ge 2 ]] ; then + local cwd_max_length=$1 + else + # if bash < v3.2 then don't truncate + return + fi ;; esac |