mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
fix conditional where tilde (~) was not properly expanding to user's home directory
This commit is contained in:
parent
23ecda6bae
commit
448696ef9b
25
autojump.zsh
25
autojump.zsh
@ -15,32 +15,31 @@
|
||||
#along with autojump. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# determine the data directory according to the XDG Base Directory Specification
|
||||
if [ -n "${XDG_DATA_HOME}" ]; then
|
||||
if [[ -n ${XDG_DATA_HOME} ]]; then
|
||||
export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
|
||||
else
|
||||
export AUTOJUMP_DATA_DIR=~/.local/share/autojump
|
||||
export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump
|
||||
fi
|
||||
|
||||
if [ ! -e "${AUTOJUMP_DATA_DIR}" ]; then
|
||||
if [[ ! -e ${AUTOJUMP_DATA_DIR} ]]; then
|
||||
mkdir -p "${AUTOJUMP_DATA_DIR}"
|
||||
mv ~/.autojump_py "${AUTOJUMP_DATA_DIR}/autojump_py" 2>>/dev/null #migration
|
||||
mv ~/.autojump_py.bak "${AUTOJUMP_DATA_DIR}/autojump_py.bak" 2>>/dev/null
|
||||
mv ~/.autojump_errors "${AUTOJUMP_DATA_DIR}/autojump_errors" 2>>/dev/null
|
||||
mv ${HOME}/.autojump_py "${AUTOJUMP_DATA_DIR}/autojump_py" 2>>/dev/null #migration
|
||||
mv ${HOME}/.autojump_py.bak "${AUTOJUMP_DATA_DIR}/autojump_py.bak" 2>>/dev/null
|
||||
mv ${HOME}/.autojump_errors "${AUTOJUMP_DATA_DIR}/autojump_errors" 2>>/dev/null
|
||||
fi
|
||||
|
||||
# set paths if necessary for local installations
|
||||
if [[ -d "~/.autojump/" ]]; then
|
||||
path=(~/.autojump/bin $path)
|
||||
fpath=(~/.autojump/functions/ $fpath)
|
||||
if [[ -d ${HOME}/.autojump ]]; then
|
||||
path=(${HOME}/.autojump/bin ${path})
|
||||
fpath=(${HOME}/.autojump/functions/ ${fpath})
|
||||
fi
|
||||
# set fpath if necessary for homebrew installation
|
||||
if [ -d "`brew --prefix 2>/dev/null`/share/zsh/functions" ]; then
|
||||
fpath=(`brew --prefix`/share/zsh/functions $fpath)
|
||||
if [[ -d "`brew --prefix 2>/dev/null`/share/zsh/functions" ]]; then
|
||||
fpath=(`brew --prefix`/share/zsh/functions ${fpath})
|
||||
fi
|
||||
|
||||
function autojump_preexec() {
|
||||
if [[ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]]
|
||||
then
|
||||
if [[ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]]; then
|
||||
_PWD_ARGS=""
|
||||
else
|
||||
_PWD_ARGS="-P"
|
||||
|
Loading…
Reference in New Issue
Block a user