dotfiles/deactivate_proj
Dan Buch a8cd5a2fe9 Attempting to carve out a sensible chunk of stuff for a dotfiles repo.
Sure hope I didn't miss any super secret crap :-P
2012-02-26 14:38:01 -05:00

33 lines
870 B
Bash

#!/bin/sh
__run_deactivate()
{
if [ -n "$1" ] ; then
project=${1}
PROJDIR=${HOME}/src/${project}
if [[ -d $PROJDIR ]] ; then
export PROJSRC=${PROJDIR}/src/${project}
export PROJBIN=${PROJDIR}/bin
if [[ -e deactivate ]] ; then
deactivate ${PROJBIN}/activate
fi
echo "${project} deactivated"
unset _HAS_GIT _HAS_HG _HG_BRANCH PROJ
cd "${HOME}"
source ${HOME}/.bash_profile
elif [[ -e deactivate ]] ; then
deactivate
else
echo "You are not in project ${project}."
echo "Furthermore, the 'deactivate' function does not exist right now."
fi
else
echo "Usage: $HOME/.deactivate_proj <projname>"
fi
}
__run_deactivate "$@"
unset __run_deactivate
# vim:ft=sh