From 12e4ee29ef50bfe6bdb8e2d1cced56fe870bd449 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Wed, 2 Aug 2017 17:29:58 -0500 Subject: [PATCH] Start zsh 5.0 branch Fail loading zim if zsh version < 5.0. Also fix git-info failing in zsh 5.0.8 as reported in #176 and #177. Closes #201. Fixes #176. Fixes #184. --- init.zsh | 5 +++-- modules/git-info/init.zsh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/init.zsh b/init.zsh index 8b48c94..ecbb868 100755 --- a/init.zsh +++ b/init.zsh @@ -3,8 +3,9 @@ # autoload -Uz is-at-least -if ! is-at-least 5.2; then - print "WARNING: Support for zsh < 5.2 will be removed in a future update. Update your version of zsh now to prevent any interruptions." >&2 +if ! is-at-least 5.0; then + print "ERROR: Zim didn't start. You're using zsh version ${ZSH_VERSION}, and versions < 5.0 are not supported. Update your zsh." >&2 + return 1 fi # Define zim location diff --git a/modules/git-info/init.zsh b/modules/git-info/init.zsh index 66bb885..00e3c22 100644 --- a/modules/git-info/init.zsh +++ b/modules/git-info/init.zsh @@ -178,7 +178,8 @@ git-info() { local ahead_and_behind_cmd='command git rev-list --count --left-right HEAD...@{upstream}' # Get ahead and behind counts. - local ahead_and_behind=$(${(z)ahead_and_behind_cmd} 2>/dev/null) + local ahead_and_behind + ahead_and_behind=$(${(z)ahead_and_behind_cmd} 2>/dev/null) local ahead=${ahead_and_behind[(w)1]} local behind=${ahead_and_behind[(w)2]}