a8cd5a2fe9
Sure hope I didn't miss any super secret crap :-P
33 lines
870 B
Bash
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
|