summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob <rjl6789@users.noreply.github.com>2020-06-08 12:16:20 +0100
committerGitHub <noreply@github.com>2020-06-08 07:16:20 -0400
commit97708ce11eff2c145c551d391cbf4d5ee3f85c10 (patch)
treeda34c1813b1fa6353b4add8638b070cc8203ed3d
parent9ec2a49af03cf542c7db82bc0dd0ccdde81922d4 (diff)
fix blank opt flag (#454)
If no options are passed but the accounts are specified then the blank opt flag causes a (harmless) error message from mbsync about an empy channel. Co-authored-by: rjl6789 <rlives6789@gmail.com>
-rwxr-xr-xbin/mailsync2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/mailsync b/bin/mailsync
index a90c6c9..4050eba 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -30,7 +30,7 @@ fi
# Check account for new mail. Notify if there is new content.
syncandnotify() {
acc="$(echo "$account" | sed "s/.*\///")"
- mbsync "$opts" "$acc"
+ 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/" -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null)
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
if [ "$newcount" -gt "0" ]; then