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:
parent
6a529f4f92
commit
57b3beff30
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user