X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/4132348c17d6a911c29984f14f3637addfb6e719..ce9777d2eb1dd03c5124dca2add71213b550d59f:/mbsync/sync-mail?ds=inline diff --git a/mbsync/sync-mail b/mbsync/sync-mail new file mode 100755 index 0000000..e9cf8d9 --- /dev/null +++ b/mbsync/sync-mail @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +mbsync_args="$*" + +export dir="$(dirname "${BASH_SOURCE[0]}")" +export config=$dir/config + +for hook in $(find $dir/pre-sync.d -type f -name '*.hook' -executable); do + "$hook" $mbsync_args +done + +mbsync -c "$config" $mbsync_args +export mbsync_errno=$? + +for hook in $(find $dir/post-sync.d -type f -name '*.hook' -executable); do + "$hook" $mbsync_args +done + +exit $mbsync_errno