Skip to content

Commit

Permalink
Fix #138
Browse files Browse the repository at this point in the history
- Add Zsh version check earlier in the load
  • Loading branch information
mattmc3 committed Aug 7, 2023
1 parent 5e0d20b commit 936a877
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 11 additions & 5 deletions antidote.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ if test -z "$ZSH_VERSION"; then
shellname=$(ps -p $$ -oargs= | awk 'NR=1{print $1}')
echo >&2 "antidote: Expecting zsh. Found '$shellname'."
return 1
fi
else
autoload -Uz is-at-least
if ! is-at-least 5.4.2; then
echo >&2 "antidote: Unsupported Zsh version '$ZSH_VERSION'. Expecting Zsh >5.4.2."
return 1
fi

typeset -f __antidote_setup &>/dev/null && unfunction __antidote_setup
0=${(%):-%N}
autoload -Uz ${0:A:h}/functions/__antidote_setup
__antidote_setup
typeset -f __antidote_setup &>/dev/null && unfunction __antidote_setup
0=${(%):-%N}
autoload -Uz ${0:A:h}/functions/__antidote_setup
__antidote_setup
fi
8 changes: 1 addition & 7 deletions functions/__antidote_setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

### Setup antidote.
#function __antidote_setup {
# zsh prereq
autoload -Uz is-at-least
if ! is-at-least 5.4.2; then
print >&2 "antidote: Unsupported Zsh version '$ZSH_VERSION'. Expecting Zsh >5.4.2."
return 1
fi

0=${(%):-%x}
fpath=( "${0:A:h}" $fpath )
local fn
Expand All @@ -24,6 +17,7 @@
export MANPATH="${0:A:h:h}/man:$MANPATH"
fi

autoload -Uz is-at-least
if is-at-least 5.8; then
# the -F option was added in 5.8
typeset -gHa _adote_zparopt_flags=( -D -M -F )
Expand Down

0 comments on commit 936a877

Please sign in to comment.