append error log if stuff breaks

pull/252/head
William Ting 11 years ago
parent de85828b79
commit 4716493681

@ -4,6 +4,16 @@ if [ -d ~/.autojump/ ]; then
fi
# set error file location
if [[ "$(uname)" == "Darwin" ]]; then
export AUTOJUMP_ERROR_PATH=~/Library/autojump/errors.log
elif [[ -n "${XDG_DATA_HOME}" ]]; then
export AUTOJUMP_ERROR_PATH="${XDG_DATA_HOME}/autojump/errors.log"
else
export AUTOJUMP_ERROR_PATH=~/.local/share/autojump/errors.log
fi
# enable tab completion
_autojump() {
local cur
@ -20,7 +30,7 @@ complete -F _autojump j
# change pwd hook
autojump_add_to_database() {
(autojump -a "$(pwd)" &) &>/dev/null
(autojump --add "$(pwd)" >/dev/null 2>${AUTOJUMP_ERROR_PATH} &) &>/dev/null
}
case $PROMPT_COMMAND in

@ -17,6 +17,7 @@ end
# misc helper functions
function __aj_err
# TODO(ting|2014-01-07): set error file location
echo $argv 1>&2; false
end

@ -11,12 +11,19 @@ command -v brew &>/dev/null \
&& fpath=(`brew --prefix`/share/zsh/site-functions ${fpath})
# tab completion handled by _j file
# set error file location
if [[ "$(uname)" == "Darwin" ]]; then
export AUTOJUMP_ERROR_PATH=~/Library/autojump/errors.log
elif [[ -n "${XDG_DATA_HOME}" ]]; then
export AUTOJUMP_ERROR_PATH="${XDG_DATA_HOME}/autojump/errors.log"
else
export AUTOJUMP_ERROR_PATH=~/.local/share/autojump/errors.log
fi
# change pwd hook
autojump_chpwd() {
(autojump -a "$(pwd)" &) &>/dev/null
autojump --add "$(pwd)" >/dev/null 2>${AUTOJUMP_ERROR_PATH} &!
}
typeset -gaU chpwd_functions

Loading…
Cancel
Save