Attempting to carve out a sensible chunk of stuff for a dotfiles repo.
Sure hope I didn't miss any super secret crap :-P
This commit is contained in:
32
deactivate_proj
Normal file
32
deactivate_proj
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
Reference in New Issue
Block a user