Преглед изворни кода

append error log if stuff breaks

pull/252/head
William Ting пре 10 година
родитељ
комит
4716493681
3 измењених фајлова са 21 додато и 3 уклоњено
  1. +11
    -1
      bin/autojump.bash
  2. +1
    -0
      bin/autojump.fish
  3. +9
    -2
      bin/autojump.zsh

+ 11
- 1
bin/autojump.bash Прегледај датотеку

@ -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

+ 1
- 0
bin/autojump.fish Прегледај датотеку

@ -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

+ 9
- 2
bin/autojump.zsh Прегледај датотеку

@ -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…
Откажи
Сачувај