From 01e06b931a0cdf6f5476857c81095fa69cb95007 Mon Sep 17 00:00:00 2001
From: Thomas Boyer <warbeaver@pm.me>
Date: Tue, 10 Dec 2024 15:04:39 +0100
Subject: [PATCH] feat(direnv): warn user if direnv not found

Instead of silently not installing the shell hooks, issue a warning (then keep doing nothing).
---
 plugins/direnv/direnv.plugin.zsh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh
index 0a33194dd..539562110 100644
--- a/plugins/direnv/direnv.plugin.zsh
+++ b/plugins/direnv/direnv.plugin.zsh
@@ -1,5 +1,8 @@
-# Don't continue if direnv is not found
-command -v direnv &>/dev/null || return
+# If direnv is not found, don't continue and print a warning
+if ! command -v direnv &>/dev/null; then
+  echo "Warning: direnv not found. Please install direnv and ensure it's in your PATH before using this plugin."
+  return
+fi
 
 _direnv_hook() {
   trap -- '' SIGINT;