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
|
# change pwd hook
|
||||||
autojump_add_to_database() {
|
autojump_add_to_database() {
|
||||||
if [[ -f "${AUTOJUMP_ERROR_PATH}" ]]; then
|
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
|
else
|
||||||
(autojump --add "$(pwd)" >/dev/null &) &>/dev/null
|
(autojump --add "${PWD}" >/dev/null &) &>/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ end
|
|||||||
# change pwd hook
|
# change pwd hook
|
||||||
function __aj_add --on-variable PWD
|
function __aj_add --on-variable PWD
|
||||||
status --is-command-substitution; and return
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@ fi
|
|||||||
# change pwd hook
|
# change pwd hook
|
||||||
autojump_chpwd() {
|
autojump_chpwd() {
|
||||||
if [[ -f "${AUTOJUMP_ERROR_PATH}" ]]; then
|
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
|
else
|
||||||
autojump --add "$(pwd)" >/dev/null &!
|
autojump --add "${PWD}" >/dev/null &!
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user