mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
fix(containers): correctly setup shell completion for orb
This commit is contained in:
@@ -30,12 +30,21 @@ if command-exists podman; then
|
|||||||
alias pc="podman-compose"
|
alias pc="podman-compose"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command-exists orbctl; then
|
if command-exists orb; then
|
||||||
alias oc="orbctl"
|
alias oc="orb"
|
||||||
|
|
||||||
if [ ! -f "${DOTZSH_SITEFUNS}/_orbctl" ]; then
|
_setup-orb-completion() {
|
||||||
echo "Setting up completion for orbctl -- ${DOTZSH_SITEFUNS}/_orbctl"
|
local target
|
||||||
orbctl completion zsh > "${DOTZSH_SITEFUNS}/_orbctl"
|
target="${ZSH_COMPLETIONS}/_orb"
|
||||||
chmod +x "${DOTZSH_SITEFUNS}/_orbctl"
|
|
||||||
fi
|
if [ ! -f "$target" ] || [ "$target" -ot "$(command -v orb)" ]; then
|
||||||
|
echo "Setting up completion for orb -- $target"
|
||||||
|
mkdir -p "$(dirname "$target")"
|
||||||
|
orb completion zsh > "$target"
|
||||||
|
chmod +x "$target"
|
||||||
|
autoload -U compinit && compinit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_setup-orb-completion
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user