New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Pipenv layout #314

Merged
merged 4 commits into from Dec 1, 2017
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+21 −0
Diff settings

Always

Just for now

Copy path View file
@@ -427,6 +427,27 @@ layout_python3() {
layout_python python3 "$@"
}

# Usage: layout pipenv
#
# Similar to layout_python, but uses Pipenv to build a
# virtualenv from the Pipfile located in the same directory.
#
layout_pipenv() {
if [[ ! -f Pipfile ]]; then
log_error 'No Pipfile found. Use `pipenv` to create a Pipfile first.'
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)
PATH_add "$VIRTUAL_ENV/bin"
export PIPENV_ACTIVE=1
}

# Usage: layout ruby
#
# Sets the GEM_HOME environment variable to "$(direnv_layout_dir)/ruby/RUBY_VERSION".
ProTip! Use n and p to navigate between commits in a pull request.