Skip to content

Commit

Permalink
Fix bug in 72d8dcf
Browse files Browse the repository at this point in the history
Related to #571.
  • Loading branch information
marlonrichert committed May 12, 2023
1 parent 584bcba commit 1a29a30
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/.autocomplete.__init__
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ local -P old_logdir=$xdg_data_home/zsh-autocomplete/log
zf_rm -fr -- $old_logdir

local -P logdir=${XDG_STATE_HOME:-$HOME/.local/state}/zsh-autocomplete/log
local -P bug=$logdir
while [[ -e $bug && ! -d $bug ]]; do
rm -f $bug
bug=${bug:h}

local -P bug=
for bug in ${logdir} ${logdir:h}; do
[[ -d $bug ]] ||
zf_rm -f $bug
done

zf_mkdir -p -- $logdir
local -Pa older_than_a_week=( $logdir/*(Nmd+7) )
(( $#older_than_a_week[@] )) &&
Expand Down

0 comments on commit 1a29a30

Please sign in to comment.