Created
October 30, 2023 17:09
-
-
Save jeremedia/679a6307c3069e35579428eba10063eb to your computer and use it in GitHub Desktop.
Loading NVM in non-interactive shells
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: https://github.com/koenpunt/capistrano-nvm/issues/25#issuecomment-320825075 | |
Put your NVM source script in your .bashrc which is still evaluated even during an non-interactive SSH session. Just make sure you place the declarations at the top, before the case statement: | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment