Created
March 31, 2014 15:26
-
-
Save nurv/9894895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python manage.py anywhere | |
_pmanage_backsearch(){ | |
if [ ! -f manage.py ]; then | |
if [[ `pwd` == "/" ]]; then | |
echo "Not within a Django Project" | |
else | |
cd .. | |
_pmanage_backsearch | |
fi | |
else | |
if [[ $dir != `pwd` ]]; then | |
echo "$fg[green]Using `pwd`$reset_color" | |
fi | |
python manage.py $args | |
fi | |
} | |
function _pmanage(){ | |
local dir=`pwd` | |
local args=$@ | |
_pmanage_backsearch | |
cd $dir | |
} | |
alias p=_pmanage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment