mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 10:06:40 +00:00
fix(zoxide): guard cd/cdi definitions with function existence checks
Prevent errors if zoxide fails to initialize by checking that __zoxide_z and __zoxide_zi functions exist before defining wrappers.
This commit is contained in:
@@ -6,6 +6,10 @@ if command-exists zoxide; then
|
|||||||
cached-eval "$(command-path zoxide)" zoxide init --cmd zox zsh
|
cached-eval "$(command-path zoxide)" zoxide init --cmd zox zsh
|
||||||
|
|
||||||
# Use functions to allow regular zsh completion for cd to work.
|
# Use functions to allow regular zsh completion for cd to work.
|
||||||
cd() { __zoxide_z "$@"; }
|
if command-exists __zoxide_z; then
|
||||||
alias cdi='__zoxide_zi'
|
cd() { __zoxide_z "$@"; }
|
||||||
|
fi
|
||||||
|
if command-exists __zoxide_zi; then
|
||||||
|
alias cdi='__zoxide_zi'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user