From 57b3beff30ae22086d41303be238d3e50c9164e2 Mon Sep 17 00:00:00 2001 From: LinuxMercedes Date: Mon, 29 Jan 2018 09:44:51 -0600 Subject: [PATCH] Switch from calling pwd to reading $PWD in cd hooks --- bin/autojump.bash | 4 ++-- bin/autojump.fish | 2 +- bin/autojump.zsh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/autojump.bash b/bin/autojump.bash index 379e529..d34bbc7 100644 --- a/bin/autojump.bash +++ b/bin/autojump.bash @@ -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 } diff --git a/bin/autojump.fish b/bin/autojump.fish index e995506..c2030b5 100644 --- a/bin/autojump.fish +++ b/bin/autojump.fish @@ -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 diff --git a/bin/autojump.zsh b/bin/autojump.zsh index a761206..b700b29 100644 --- a/bin/autojump.zsh +++ b/bin/autojump.zsh @@ -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 }