Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function django_complete {
- if [ -z $VIRTUAL_ENV ]; then
- return
- fi
- DJANGO_MANAGE="$(find $VIRTUAL_ENV |grep 'manage.py')"
- if [ -z $DJANGO_MANAGE ]; then
- return
- fi
- if [ ! -f $VIRTUAL_ENV/bin/activate_original ]; then
- cp $VIRTUAL_ENV/bin/activate $VIRTUAL_ENV/bin/activate_orig
- fi
- cp $VIRTUAL_ENV/bin/activate $VIRTUAL_ENV/bin/old_activate
- echo '' > $VIRTUAL_ENV/bin/activate
- cat $VIRTUAL_ENV/bin/activate | grep -v 'manage.py' >> $VIRTUAL_ENV/bin/activate
- DJANGO_MANAGE_COMMANDS="complete -W $(python $DJANGO_MANAGE | grep -E '^ [a-z]+$' | sed 's/ //' |tr '\n' ' ') manage.py"
- if [ -f $VIRTUAL_ENV/bin/activate ]; then
- #echo "$DJANGO_MANAGE_COMMANDS" >> $VIRTUAL_ENV/bin/activate
- echo 'wtf'
- fi
- echo $DJANGO_MANAGE_COMMANDS
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement