Skip to content

Instantly share code, notes, and snippets.

@abc101
Last active September 17, 2020 01:11
Show Gist options
  • Save abc101/06f2b2189f2069129036903aeb91ec15 to your computer and use it in GitHub Desktop.
Save abc101/06f2b2189f2069129036903aeb91ec15 to your computer and use it in GitHub Desktop.
direnvrc for pyenv and nvm
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
}
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