pytube / .envrc
nficano's picture
use pipenv, added contrib
e5fc29e
raw
history blame
648 Bytes
# TODO: This function is only necessary until
# https://github.com/direnv/direnv/pull/314 gets accepted
# -------------------- 8< ---------------------------------
layout_pipenv() {
if [[ ! -f Pipfile ]]; then
echo 'No Pipfile found. Use `pipenv` to create a Pipfile first.' >&2
exit 2
fi
local VENV=$(pipenv --bare --venv 2>/dev/null)
if [[ -z $VENV || ! -d $VENV ]]; then
pipenv install --dev
fi
export VIRTUAL_ENV=$(pipenv --venv)
export PIPENV_ACTIVE=1
PATH_add "$VIRTUAL_ENV/bin"
}
# -------------------- 8< ---------------------------------
layout pipenv
# Will add node_modules/.bin to the $PATH
layout node