[notmuch] Replace pre-new script with SCSH script

This also handles finding 0 emails that have the ‘deleted’ tag without showing
an error.
This commit is contained in:
Tom Willemse 2022-05-29 17:00:13 -07:00
parent 6c3bf82014
commit e7bac680ad

View file

@ -1,4 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env sh
# # -*- mode:scheme; -*-
IFS=" "
exec scsh -s "$0" "$@"
!#
notmuch search --output=files tag:deleted | tr '\n' '\0' | xargs -0 -L 1 rm -v (define deleted
mbsync -a (run/sexp (notmuch search --output=files --format=sexp tag:deleted)))
(if (> (length deleted) 0)
(map (lambda (mail) (run (rm -v ,mail))) deleted))
(run (mbsync -a))