From 640df9986cdfc66b1557a5048fc063089825fc04 Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Fri, 21 Jun 2024 16:47:07 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20Correction=20gestion=20direnv=20lorsqu'i?= =?UTF-8?q?l=20n'est=20pas=20install=C3=A9=20via=20asdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rc.d/direnv | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/rc.d/direnv b/rc.d/direnv index 5d47ece..023376c 100644 --- a/rc.d/direnv +++ b/rc.d/direnv @@ -1,24 +1,16 @@ #!/bin/bash -if ( which asdf &> /dev/null ) -then +if (asdf which direnv &>/dev/null); then + # Hook direnv into your shell. + eval "$(asdf exec direnv hook bash)" - if ( asdf which direnv &> /dev/null ) - then + # A shortcut for asdf managed direnv. + direnv() { asdf exec direnv "$@"; } - # Hook direnv into your shell. - eval "$(asdf exec direnv hook bash)" + return - # A shortcut for asdf managed direnv. - direnv() { asdf exec direnv "$@"; } - - return - fi - -elif ( which direnv &> /dev/null ) -then - - # Hook direnv into your shell. - eval "$(direnv hook bash)" +elif (command -v direnv &>/dev/null); then + # Hook direnv into your shell. + eval "$(direnv hook bash)" fi