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

bash: call autojump -a only if CWD changed

This commit is contained in:
jj 2013-09-12 13:54:02 +02:00
parent 986f02124e
commit a1baa90dc0

View File

@ -57,7 +57,11 @@ fi
autojump_add_to_database() {
if [[ "${AUTOJUMP_HOME}" == "${HOME}" ]]; then
autojump -a "$(pwd ${_PWD_ARGS})" 1>/dev/null 2>>"${AUTOJUMP_DATA_DIR}/autojump_errors"
AUTOJUMP_CWD="$(pwd ${_PWD_ARGS})"
if [[ "$AUTOJUMP_CWD" != "$AUTOJUMP_LASTWD" ]]; then
autojump -a "$AUTOJUMP_CWD" 1>/dev/null 2>>"${AUTOJUMP_DATA_DIR}/autojump_errors"
AUTOJUMP_LASTWD="$AUTOJUMP_CWD"
fi
fi
}