You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
870 B

#!/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