Update command checks to use a faster method

This commit is contained in:
Jonny Barnes 2024-07-06 12:18:09 +01:00
parent 6ce632755c
commit 83b6e927c6
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
7 changed files with 7 additions and 7 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Setup Fast Node Manager # Setup Fast Node Manager
if type fnm > /dev/null; then if (( ${+commands[fnm]} )); then
eval "$(fnm env --use-on-cd)" eval "$(fnm env --use-on-cd)"
fi fi

View file

@ -1,6 +1,6 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Setup fzf completions # Setup fzf completions
if type fzf > /dev/null; then if (( ${+commands[fzf]} )); then
eval "$(fzf --zsh)" eval "$(fzf --zsh)"
fi fi

View file

@ -2,7 +2,7 @@
# Setup GitHub Copilot # Setup GitHub Copilot
# first check we even have the genereic `gh` command # first check we even have the genereic `gh` command
if type gh > /dev/null; then if (( ${+commands[gh]} )); then
# Now check we have the copilot plugin installed with `gh` # Now check we have the copilot plugin installed with `gh`
if gh extension list | rg copilot -c > /dev/null; then if gh extension list | rg copilot -c > /dev/null; then
eval "$(gh copilot alias -- zsh)" eval "$(gh copilot alias -- zsh)"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# McFly # McFly
if type mcfly > /dev/null; then if (( ${+commands[mcfly]} )); then
eval "$(mcfly init zsh)" eval "$(mcfly init zsh)"
fi fi

View file

@ -1,6 +1,6 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# ngrok completions # ngrok completions
if command -v ngrok &>/dev/null; then if (( ${+commands[ngrok]} )); then
eval "$(ngrok completion)" eval "$(ngrok completion)"
fi fi

View file

@ -1,6 +1,6 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# Init the fuck # Init the fuck
if type thefuck > /dev/null; then if (( ${+commands[thefuck]} )); then
eval "$(thefuck --alias)" eval "$(thefuck --alias)"
fi fi

View file

@ -1,6 +1,6 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# zoxide - a better `cd` command # zoxide - a better `cd` command
if command -v zoxide &>/dev/null; then if (( ${+commands[zoxide]} )); then
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
fi fi