Skip to content

Instantly share code, notes, and snippets.

@mathcass
Created June 19, 2018 22:43
Show Gist options
  • Save mathcass/2d6b8a183d742f484a9385c32ad80b0d to your computer and use it in GitHub Desktop.
Save mathcass/2d6b8a183d742f484a9385c32ad80b0d to your computer and use it in GitHub Desktop.
Direnv function to aid with loading local virtualenv directories
# Usage: layout_virtualenv <path>
#
# Sets and loads a Python virtualenvironment from a local path
# Eg. `layout_virtualenv venv`
layout_virtualenv() {
local venv_path=${1:-venv}
log_status "Loading $venv_path"
load_prefix ${venv_path}
source ${venv_path}/bin/activate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment