fix(direnv): warn user if command not found (#12840)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Diff
1diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh
2index 0a33194ddf315a4f8036d1a946f5de35cfd60d7b..c026dbe763b5539445ea66ca2ccc799e229feee7 100644
3--- a/plugins/direnv/direnv.plugin.zsh
4+++ b/plugins/direnv/direnv.plugin.zsh
5@@ -1,5 +1,8 @@
6-# Don't continue if direnv is not found
7-command -v direnv &>/dev/null || return
8+# If direnv is not found, don't continue and print a warning
9+if (( ! $+commands[direnv] )); then
10+ echo "Warning: direnv not found. Please install direnv and ensure it's in your PATH before using this plugin."
11+ return
12+fi
1314 _direnv_hook() {
15 trap -- '' SIGINT;