#!/bin/bash # # virtualenv-burrito # # One command to have a working virtualenv + virtualenvwrapper environment. # set -e VENVBURRITO="$HOME/.venvburrito" VENVBURRITO_esc="\$HOME/.venvburrito" MASTER_URL="https://raw.githubusercontent.com/brainsik/virtualenv-burrito/master" if [ -e "$VENVBURRITO" ]; then echo "Found existing $VENVBURRITO" echo echo "Looks like virtualenv-burrito is already installed. Bye." exit 1 fi kernel=$(uname -s) case "$kernel" in Darwin|Linux|FreeBSD) ;; *) echo "Sadly, $kernel hasn't been tested. :'("; exit 1 esac # provide a friendly way to set this environment variable test "$1" = "--exclude-profile" && exclude_profile="yep" backup_profile() { profile="$1" cp -p $HOME/$profile $HOME/${profile}.pre-virtualenv-burrito } write_simple_startup() { profile="$1" cat >> ~/$profile <> ~/$profile < ~/$profile < $VENVBURRITO/bin/virtualenv-burrito chmod 755 $VENVBURRITO/bin/virtualenv-burrito cmd="virtualenv-burrito upgrade firstrun" echo -e "\nRunning: $cmd" $VENVBURRITO/bin/$(echo $cmd) unset profile test -z "$exclude_profile" && modify_profile if [ -n "$profile" ]; then if [ -e $HOME/${profile}.pre-virtualenv-burrito ]; then backup=" The original\nwas saved to ~/$profile.pre-virtualenv-burrito." fi echo echo "Code was added to $HOME/$profile so the virtualenvwrapper" echo -e "environment will be available when you login.$backup" fi echo echo "Done with setup!" echo echo "To start now, run this:" echo "source $VENVBURRITO/startup.sh"