1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Use zsh version agnostic approach regarding substring matching

This commit is contained in:
William Ting 2012-05-27 13:04:24 -10:00
parent c2d72e442a
commit 1b765ab8a6

View File

@ -1,15 +1,8 @@
# determine the data directory according to the XDG Base Directory Specification
autoload -U is-at-least
export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump
if is-at-least 4.3.5; then
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} =~ ${USER} ]]; then
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} == *${USER}* ]]; then
export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
fi
else
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} -pcre-match ${USER} ]]; then
export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
fi
export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump
fi
if [[ ! -e ${AUTOJUMP_DATA_DIR} ]]; then