diff options
| author | Thomas Boyer <warbeaver@pm.me> | 2025-01-23 20:37:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-23 20:37:00 +0100 |
| commit | 1bae19973671dde75506c541ba576de4dae8cb29 (patch) | |
| tree | aab3690d496ef4209bcd8279d69dbbb11af2a6bf /plugins/direnv | |
| parent | bd0a5b2598f5614aa60b056783cd3acb803c664a (diff) | |
| download | zsh-1bae19973671dde75506c541ba576de4dae8cb29.tar.gz zsh-1bae19973671dde75506c541ba576de4dae8cb29.tar.bz2 zsh-1bae19973671dde75506c541ba576de4dae8cb29.zip | |
fix(direnv): warn user if command not found (#12840)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Diffstat (limited to 'plugins/direnv')
| -rw-r--r-- | plugins/direnv/direnv.plugin.zsh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh index 0a33194dd..c026dbe76 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 (( ! $+commands[direnv] )); 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; |
