Last active
September 17, 2020 01:11
-
-
Save abc101/06f2b2189f2069129036903aeb91ec15 to your computer and use it in GitHub Desktop.
direnvrc for pyenv and nvm
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
use_python() { | |
if [ -n "$(which pyenv)" ]; then | |
local pyversion=$1 | |
pyenv local ${pyversion} | |
fi | |
} | |
layout_virtualenv() { | |
local venv_path="$1" | |
source ${venv_path}/bin/activate | |
} | |
layout_virtualenvwrapper() { | |
local venv_path="${WORKON_HOME}/$1" | |
layout_virtualenv $venv_path | |
} | |
use_nvm() { | |
local node_version=$1 | |
nvm_sh=~/.nvm/nvm.sh | |
if [[ -e $nvm_sh ]]; then | |
source $nvm_sh | |
nvm use $node_version | |
fi | |
} |
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
use python 3.8.5 | |
layout virtualenvwrapper direnv-example | |
unset PS1 | |
use nvm v12.18.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment