mirror of
https://github.com/Crocmagnon/dotfiles.git
synced 2024-12-22 05:41:51 +01:00
Update kdjango
This commit is contained in:
parent
ec63bd4486
commit
3de8666949
1 changed files with 5 additions and 2 deletions
|
@ -1,11 +1,12 @@
|
|||
# Defined interactively
|
||||
function kdjango --description 'Pop into the shell of django pod of the current namespace'
|
||||
argparse -x "h,b,s,m" "h/help" "b/bash" "s/sh" "m/manage" -- $argv; or return
|
||||
argparse -x "h,b,s,m" "h/help" "b/bash" "s/sh" "m/manage" "o/original-shell" -- $argv; or return
|
||||
if set -q _flag_h
|
||||
echo "Exec into the django pod of the current namespace..."
|
||||
echo -e "kdjango [-b]\t ...using bash (default if no option)"
|
||||
echo -e "kdjango -s\t ...using sh"
|
||||
echo -e "kdjango -m\t ...using manage.py shell"
|
||||
echo -e "kdjango -m\t ...using manage.py shell_plus"
|
||||
echo -e "kdjango -o\t ...using manage.py shell"
|
||||
echo -e "\nRequires kubens for namespace selection"
|
||||
return
|
||||
end
|
||||
|
@ -15,6 +16,8 @@ function kdjango --description 'Pop into the shell of django pod of the current
|
|||
else if set -q _flag_s
|
||||
set command /bin/sh
|
||||
else if set -q _flag_m
|
||||
set command ./manage.py shell_plus
|
||||
else if set -q _flag_o
|
||||
set command ./manage.py shell
|
||||
end
|
||||
set pod (kubectl get pods -o name | grep "django" | grep -Ev "celery|migrations" | head -1)
|
||||
|
|
Loading…
Reference in a new issue