From 7b708519b9395914fb47b6c31132fb67fb8b721b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?= <hello@mcornella.com>
Date: Thu, 10 Feb 2022 18:25:09 +0100
Subject: [PATCH] fix(emotty): show error on missing plugin dependencies
 (#9811)

---
 themes/emotty.zsh-theme | 10 ++++++++++
 1 file changed, 10 insertions(+)

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]"