1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-20 06:21:58 +00:00

another blind attempt to fix mysterious non-reproducible issues

This commit is contained in:
romkatv 2019-06-09 18:41:57 +02:00
parent 60a4562574
commit 691f5eb519

View file

@ -1566,17 +1566,17 @@ prompt_todo() {
local todo=$commands[todo.sh] local todo=$commands[todo.sh]
[[ -n $todo ]] || return [[ -n $todo ]] || return
if (( ! $+_P9K_TODO_FILE )); then if (( ! $+_P9K_TODO_FILE )); then
# There is a bug in todo.sh where it uses $0 instead of ${BASH_SOURCE[0]}. We work around local bash=${commands[bash]:-:}
# it by overriding `dirname`, to which $0 is passed as an argument. typeset -g _P9K_TODO_FILE=$($bash 2>/dev/null -c "
local script=" [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo/config
function dirname() { [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/todo.cfg
local f=\$1 [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\$HOME/.todo.cfg
[[ \"\$f\" == bash ]] && f=${(qqq)todo} [ -e \"\$TODOTXT_CFG_FILE\" ] || TODOTXT_CFG_FILE=\${XDG_CONFIG_HOME:-\$HOME/.config}/todo/config
command dirname \"\$f\" [ -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}
source ${(qqq)todo} shorthelp &>/dev/null [ -r \"\$TODOTXT_CFG_FILE\" ] || exit
echo \"\$TODO_FILE\"" source \"\$TODOTXT_CFG_FILE\" &>/dev/null
typeset -g _P9K_TODO_FILE=$(bash -c $script) echo \"\$TODO_FILE\"")
fi fi
[[ -r $_P9K_TODO_FILE ]] || return [[ -r $_P9K_TODO_FILE ]] || return
local -H stat local -H stat