From 9e0ee9b26e5a2f5b149e343b15e2131c04d9e68b Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Thu, 17 Aug 2023 14:57:44 -0500 Subject: [PATCH] Update install.sh --- install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 6cd0916..9954cdd 100644 --- a/install.sh +++ b/install.sh @@ -24,6 +24,14 @@ else curl -fsSLo direnv "https://github.com/direnv/direnv/releases/download/v$VERSION/direnv.freebsd-$architecture" - chmod +x direnv + chmod 777 direnv mv direnv /usr/local/bin/direnv fi + +echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..." +if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then + echo -e 'eval "$(direnv hook bash)"' >> /etc/bash.bashrc +fi +if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then + echo -e 'eval "$(direnv hook zsh)"' >> /etc/zsh/zshrc +fi