15 lines
495 B
Bash
15 lines
495 B
Bash
#!/bin/sh
|
|
# shell plugins for POSIX
|
|
|
|
# Enable zoxide if it exists
|
|
if command -v zoxide > /dev/null 2>&1 || ${SKIP_ZOXIDE:-false}; then
|
|
# Check what shell we're using based on variables that get set by non-posix shells - https://stackoverflow.com/a/3327022
|
|
if [ -n "${ZSH_NAME+set}" ]; then # zsh
|
|
eval "$(zoxide init zsh)"
|
|
elif [ -n "${BASH+set}" ]; then # bash
|
|
eval "$(zoxide init bash)"
|
|
else
|
|
# assume posix
|
|
eval "$(zoxide init posix --hook prompt)"
|
|
fi
|
|
fi
|