aboutsummaryrefslogtreecommitdiffstats
path: root/modules/scripts/aerc-sync-mail.sh
blob: 0a69346147d6db697572b5fb44a5c71eb5e0fcf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
set -euo pipefail

target="${1:--a}"
mail_root="${XDG_DATA_HOME:-$HOME/.local/share}/mail"
mkdir -p "$mail_root"

if [[ "$target" == "all" ]]; then
  target="-a"
else
  mkdir -p "${mail_root}/${target}/INBOX/cur" "${mail_root}/${target}/INBOX/new" "${mail_root}/${target}/INBOX/tmp"
fi

mbsync "$target"
notmuch new