mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 10:06:40 +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"
|
||||
fi
|
||||
|
||||
if command-exists orbctl; then
|
||||
alias oc="orbctl"
|
||||
if command-exists orb; then
|
||||
alias oc="orb"
|
||||
|
||||
if [ ! -f "${DOTZSH_SITEFUNS}/_orbctl" ]; then
|
||||
echo "Setting up completion for orbctl -- ${DOTZSH_SITEFUNS}/_orbctl"
|
||||
orbctl completion zsh > "${DOTZSH_SITEFUNS}/_orbctl"
|
||||
chmod +x "${DOTZSH_SITEFUNS}/_orbctl"
|
||||
fi
|
||||
_setup-orb-completion() {
|
||||
local target
|
||||
target="${ZSH_COMPLETIONS}/_orb"
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user