-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from embik/bash-magic
shell: make `zsh` magic more portable and add `bash` magic
- Loading branch information
Showing
3 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
alias _inline_fzf="fzf --height=50% --reverse -0 --inline-info --border" | ||
alias _kbs_bin="$(type -p kbs)" | ||
|
||
function kbs() { | ||
if [ $# -eq 0 ]; then | ||
# if no parameters are passed, we want to run fzf on available kubeconfigs and set the selected one as active kubeconfig | ||
eval "$(_kbs_bin use $(_kbs_bin ls | _inline_fzf))" | ||
else | ||
# if parameters are passed, we just call the kbs binary directly | ||
${_kbs_bin} $@ | ||
fi | ||
} |
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
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