mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 22:07:59 +00:00
Add kexec funtion to .zshrc
This commit is contained in:
parent
675c7853d8
commit
2ab0701f00
12
.zshrc
12
.zshrc
@ -70,6 +70,18 @@ dexec () {
|
|||||||
[ -n "$cid" ] && docker exec -ti "$cid" "${cmd[@]}"
|
[ -n "$cid" ] && docker exec -ti "$cid" "${cmd[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kexec () {
|
||||||
|
local cid
|
||||||
|
local cmd=("$@")
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
cmd=(bash)
|
||||||
|
fi
|
||||||
|
|
||||||
|
cid=$(kubectl get pods | sed 1d | fzf -1 | awk '{print $1}')
|
||||||
|
|
||||||
|
[ -n "$cid" ] && kubectl exec -ti "$cid" -- "${cmd[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
export FZF_DEFAULT_COMMAND="fd --type f --follow -I"
|
export FZF_DEFAULT_COMMAND="fd --type f --follow -I"
|
||||||
export FZF_DEFAULT_OPTS="-m --reverse --bind 'ctrl-o:execute(xdg-open {})+abort,ctrl-e:execute({})+abort,ctrl-y:execute(echo {} | xclip -selection clipboard -in)+abort'"
|
export FZF_DEFAULT_OPTS="-m --reverse --bind 'ctrl-o:execute(xdg-open {})+abort,ctrl-e:execute({})+abort,ctrl-y:execute(echo {} | xclip -selection clipboard -in)+abort'"
|
||||||
|
Loading…
Reference in New Issue
Block a user