SHARE
TWEET

Untitled

a guest Jul 12th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function django_complete {
  2.     if [ -z $VIRTUAL_ENV ]; then
  3.         return
  4.     fi  
  5.  
  6.     DJANGO_MANAGE="$(find $VIRTUAL_ENV |grep 'manage.py')"
  7.     if [ -z $DJANGO_MANAGE ]; then
  8.         return
  9.     fi  
  10.  
  11.     if [ ! -f $VIRTUAL_ENV/bin/activate_original ]; then
  12.         cp $VIRTUAL_ENV/bin/activate $VIRTUAL_ENV/bin/activate_orig
  13.     fi  
  14.     cp $VIRTUAL_ENV/bin/activate $VIRTUAL_ENV/bin/old_activate
  15.     echo '' > $VIRTUAL_ENV/bin/activate
  16.     cat $VIRTUAL_ENV/bin/activate | grep -v 'manage.py' >> $VIRTUAL_ENV/bin/activate
  17.     DJANGO_MANAGE_COMMANDS="complete -W $(python $DJANGO_MANAGE | grep -E '^    [a-z]+$' | sed 's/    //' |tr '\n' ' ') manage.py"
  18.     if [ -f $VIRTUAL_ENV/bin/activate ]; then
  19.         #echo "$DJANGO_MANAGE_COMMANDS" >> $VIRTUAL_ENV/bin/activate
  20.         echo 'wtf'
  21.     fi  
  22.     echo $DJANGO_MANAGE_COMMANDS
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top