summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-02-10 18:25:09 +0100
committerMarc Cornellà <hello@mcornella.com>2022-02-10 18:25:09 +0100
commit7b708519b9395914fb47b6c31132fb67fb8b721b (patch)
tree09ca10bc11378842974c18d9fc70d917ccddb918
parent6396dfb97f13f5fbb0ef98cd5221600b89ff889a (diff)
downloadzsh-7b708519b9395914fb47b6c31132fb67fb8b721b.tar.gz
zsh-7b708519b9395914fb47b6c31132fb67fb8b721b.tar.bz2
zsh-7b708519b9395914fb47b6c31132fb67fb8b721b.zip
fix(emotty): show error on missing plugin dependencies (#9811)
-rw-r--r--themes/emotty.zsh-theme10
1 files changed, 10 insertions, 0 deletions
diff --git a/themes/emotty.zsh-theme b/themes/emotty.zsh-theme
index 044b317e8..ba0840950 100644
--- a/themes/emotty.zsh-theme
+++ b/themes/emotty.zsh-theme
@@ -46,6 +46,16 @@
# is shown (see vcs_action_glyph variable, default: chevron).
# ------------------------------------------------------------------------------
+(( ${+functions[emotty]} )) || {
+ echo "error: the emotty theme requires the emotty plugin" >&2
+ return 1
+}
+
+(( ${+emoji} )) || {
+ echo "error: the emotty theme requires the emoji plugin" >&2
+ return 1
+}
+
user_prompt="$(emotty)"
root_prompt="$emoji[skull]"
warn_prompt="$emoji[collision_symbol]"