Procházet zdrojové kódy

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 před 7 roky
rodič
revize
9638d221bc
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 23F078862ACFE50
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. +3
    -1
      bin/mailsync

+ 3
- 1
bin/mailsync Zobrazit soubor

@@ -34,7 +34,9 @@ pkill -RTMIN+12 i3blocks >/dev/null 2>&1
for account in "$HOME/.local/share/mail/"*
do
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" &
done
notmuch new 2>/dev/null


Načítá se…
Zrušit
Uložit