aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-04-29 12:27:41 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-04-29 12:27:41 +0300
commitd29c30af3b1bd11566d34350a5582a5f54d1d335 (patch)
treea5ee8645e912d4fa1fe37693b51cd0b7f171d7e9 /powerlevel9k.zsh-theme
parent844326642dfe241bc107e3ffea65e002b369c9c8 (diff)
move zsh version check to the top
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme14
1 files changed, 9 insertions, 5 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 803eaca4..c4cec925 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -20,11 +20,10 @@
#zstyle ':vcs_info:*+*:*' debug true
#set -o xtrace
-test -n "$ZSH_VERSION" || exit 1
-
-if [[ -v _P9K_SOURCED ]]; then
- prompt_powerlevel9k_setup "$@"
- return
+if test -z "${ZSH_VERSION}"; then
+ echo "powerlevel10k: unsupported shell; try zsh instead" >&2
+ return 1
+ exit 1
fi
if ! autoload -U is-at-least || ! is-at-least 5.2; then
@@ -56,6 +55,11 @@ if ! autoload -U is-at-least || ! is-at-least 5.2; then
return 1
fi
+if [[ -v _P9K_SOURCED ]]; then
+ prompt_powerlevel9k_setup "$@"
+ return
+fi
+
readonly _P9K_SOURCED=1
typeset -g _P9K_INSTALLATION_DIR