Skip to content

Instantly share code, notes, and snippets.

@hodgestar
Created June 14, 2016 08:27
Show Gist options
  • Save hodgestar/0d2565548dcd2521d03f4a081bc8a773 to your computer and use it in GitHub Desktop.
Save hodgestar/0d2565548dcd2521d03f4a081bc8a773 to your computer and use it in GitHub Desktop.
Simple helper that creates virtualenvs named after the current working directory
#!/bin/sh
function lve () {
if [ -n "$1" ]
then
VENV="$1"
else
VENV=`basename "$PWD"`
fi
VENV_PATH="/home/$USER/venvs/$VENV"
if [ ! -e "$VENV_PATH" ]
then
virtualenv "$VENV_PATH"
fi
unset VENV
source "$VENV_PATH/bin/activate"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment