aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-06-09 19:41:57 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-06-09 19:41:57 +0300
commit691f5eb5194c0681669b20df6d29249a667e256b (patch)
tree6710071a176de956754b7e04492f3618efaddd94 /internal/p10k.zsh
parent60a4562574d88470e24f9ee85659cccc2ad042e9 (diff)
another blind attempt to fix mysterious non-reproducible issues
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh22
1 files changed, 11 insertions, 11 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index e683572b..32bad6be 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1566,17 +1566,17 @@ prompt_todo() {
local todo=$commands[todo.sh]
[[ -n $todo ]] || return
if (( ! $+_P9K_TODO_FILE )); then
- # There is a bug in todo.sh where it uses $0 instead of ${BASH_SOURCE[0]}. We work around
- # it by overriding `dirname`, to which $0 is passed as an argument.
- local script="
- function dirname() {
- local f=\$1
- [[ \"\$f\" == bash ]] && f=${(qqq)todo}
- command dirname \"\$f\"
- }
- source ${(qqq)todo} shorthelp &>/dev/null
- echo \"\$TODO_FILE\""
- typeset -g _P9K_TODO_FILE=$(bash -c $script)
+ local bash=${commands[bash]:-:}
+ typeset -g _P9K_TODO_FILE=$($bash 2>/dev/null -c "
+ [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo/config
+ [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/todo.cfg
+ [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo.cfg
+ [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${XDG_CONFIG_HOME:-\$HOME/.config}/todo/config
+ [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=${(qqq)todo:h}/todo.cfg
+ [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config}
+ [ -r \"\$TODOTXT_CFG_FILE\" ] || exit
+ source \"\$TODOTXT_CFG_FILE\" &>/dev/null
+ echo \"\$TODO_FILE\"")
fi
[[ -r $_P9K_TODO_FILE ]] || return
local -H stat