From c4b20f481d3918654b5f98a4d8d203b768375207 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sun, 28 Jul 2024 09:50:57 +0300 Subject: [PATCH] {bash,zsh}rc & profile.d: fix if nvm condition --- etc/profile.d/99-brew.sh | 6 ++++++ rc/bashrc | 2 +- rc/zshrc | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/etc/profile.d/99-brew.sh b/etc/profile.d/99-brew.sh index a639a42b..a5d02e65 100644 --- a/etc/profile.d/99-brew.sh +++ b/etc/profile.d/99-brew.sh @@ -2,3 +2,9 @@ if [ -d /home/linuxbrew/.linuxbrew/bin ]; then eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) fi + +if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then + export NVM_DIR=/home/linuxbrew/.nvm + [ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This loads nvm + [ -s "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion +fi diff --git a/rc/bashrc b/rc/bashrc index c31b039a..cf2e19a5 100755 --- a/rc/bashrc +++ b/rc/bashrc @@ -283,7 +283,7 @@ fi if [ -d ~/.nvm ]; then . ~/.nvm/nvm.sh . ~/.nvm/bash_completion -elif [ -f /home/linuxbrew/.linuxbrew/bin/nvm ]; then +elif [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then mkdir -p /home/linuxbrew/.nvm export NVM_DIR=/home/linuxbrew/.nvm [ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This loads nvm diff --git a/rc/zshrc b/rc/zshrc index 3a5dd8cb..16874a9d 100755 --- a/rc/zshrc +++ b/rc/zshrc @@ -237,7 +237,7 @@ fi if [ -d ~/.nvm ]; then . ~/.nvm/nvm.sh . ~/.nvm/bash_completion -elif [ -d /home/linuxbrew/.linuxbrew/bin/nvm ]; then +elif [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then mkdir -p /home/linuxbrew/.nvm export NVM_DIR=/home/linuxbrew/.nvm [ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This loads nvm