浏览代码

fix(emotty): show error on missing plugin dependencies (#9811)

Marc Cornellà 2 年之前
父节点
当前提交
7b708519b9
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      themes/emotty.zsh-theme

+ 10 - 0
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]"