Przeglądaj źródła

modify the `find` call in `mailsync` on Mac

The MacOS `find` command seems to be case insensitive. So the current
`mailsync` script results in counting each local inbox folder thrice,
resulting in the wrong # of new mails the user is notified about.
The commit implements another `test` command for `$(uname)` to decide
which arguments should be passed to `find`.

_In ref. to :_
https://github.com/LukeSmithxyz/mutt-wizard/issues/157#issuecomment-494132981
pull/213/head
Kr1ss 7 lat temu
rodzic
commit
9638d221bc
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: 23F078862ACFE50
1 zmienionych plików z 3 dodań i 1 usunięć
  1. +3
    -1
      bin/mailsync

+ 3
- 1
bin/mailsync Wyświetl plik

@@ -34,7 +34,9 @@ pkill -RTMIN+12 i3blocks >/dev/null 2>&1
for account in "$HOME/.local/share/mail/"* for account in "$HOME/.local/share/mail/"*
do do
acc="$(echo "$account" | sed "s/.*\///")" acc="$(echo "$account" | sed "s/.*\///")"
newcount=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null | wc -l)
folders="$account/INBOX/new/"
[ "$(uname)" != "Darwin" ] && folders="$folders $account/Inbox/new/ $account/inbox/new/"
newcount=$(find $folders -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2>/dev/null | wc -l)
[ "$newcount" -gt "0" ] && notify "$acc" "$newcount" & [ "$newcount" -gt "0" ] && notify "$acc" "$newcount" &
done done
notmuch new 2>/dev/null notmuch new 2>/dev/null


Ładowanie…
Anuluj
Zapisz