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

Switch from calling pwd to reading $PWD in cd hooks

This commit is contained in:
LinuxMercedes 2018-01-29 09:44:51 -06:00
parent 6a529f4f92
commit 57b3beff30
3 changed files with 5 additions and 5 deletions

View File

@ -37,9 +37,9 @@ complete -F _autojump j
# change pwd hook
autojump_add_to_database() {
if [[ -f "${AUTOJUMP_ERROR_PATH}" ]]; then
(autojump --add "$(pwd)" >/dev/null 2>>${AUTOJUMP_ERROR_PATH} &) &>/dev/null
(autojump --add "${PWD}" >/dev/null 2>>${AUTOJUMP_ERROR_PATH} &) &>/dev/null
else
(autojump --add "$(pwd)" >/dev/null &) &>/dev/null
(autojump --add "${PWD}" >/dev/null &) &>/dev/null
fi
}

View File

@ -32,7 +32,7 @@ end
# change pwd hook
function __aj_add --on-variable PWD
status --is-command-substitution; and return
autojump --add (pwd) >/dev/null 2>>$AUTOJUMP_ERROR_PATH &
autojump --add "$PWD" >/dev/null 2>>$AUTOJUMP_ERROR_PATH &
end

View File

@ -35,9 +35,9 @@ fi
# change pwd hook
autojump_chpwd() {
if [[ -f "${AUTOJUMP_ERROR_PATH}" ]]; then
autojump --add "$(pwd)" >/dev/null 2>>${AUTOJUMP_ERROR_PATH} &!
autojump --add "${PWD}" >/dev/null 2>>${AUTOJUMP_ERROR_PATH} &!
else
autojump --add "$(pwd)" >/dev/null &!
autojump --add "${PWD}" >/dev/null &!
fi
}