diff options
author | f380cedric <f380cedric@users.noreply.github.com> | 2022-06-10 18:16:29 +0200 |
---|---|---|
committer | f380cedric <f380cedric@users.noreply.github.com> | 2022-06-10 18:16:29 +0200 |
commit | 3a2f4a55fa966a6c095639193cb9ab1f3a3d8229 (patch) | |
tree | a3403d6b68234f423842677f5ae558e2701ccca8 /bin/mailsync | |
parent | cefb66a8f03cab34b21aa47aaaad17e37dc8d377 (diff) |
Fix: find & case-insensitive filesystem
On case-insensitive filesystem,
`inbox` and `Inbox` are the same path.
Running `find Inbox inbox [expr]` will print twice the same information.
Use shell glob instead:
`find` will descend into path `inbox`,
ignoring letter cases, only once.
Fix #828.
Diffstat (limited to 'bin/mailsync')
-rwxr-xr-x | bin/mailsync | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/bin/mailsync b/bin/mailsync index 2f32c14..0d2983f 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -56,12 +56,8 @@ syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi new=$(find\ - "$HOME/.local/share/mail/$acc/INBOX/new/"\ - "$HOME/.local/share/mail/$acc/Inbox/new/"\ - "$HOME/.local/share/mail/$acc/inbox/new/"\ - "$HOME/.local/share/mail/$acc/INBOX/cur/"\ - "$HOME/.local/share/mail/$acc/Inbox/cur/"\ - "$HOME/.local/share/mail/$acc/inbox/cur/"\ + "$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/new/\ + "$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/cur/\ -type f -newer "$lastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) case 1 in |