X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/68cd21a9e728be519620a9f3ae107cdb4fa6fffe..b6ba5e253ea33b0f159076b8ae1f669e76b568e9:/isync/sync-mail diff --git a/isync/sync-mail b/isync/sync-mail index 1bd0f52..e9cf8d9 100755 --- a/isync/sync-mail +++ b/isync/sync-mail @@ -2,18 +2,18 @@ mbsync_args="$*" -dir="$(dirname "${BASH_SOURCE[0]}")" -config=$dir/config +export dir="$(dirname "${BASH_SOURCE[0]}")" +export config=$dir/config -for hook in $(find $dir/pre-sync.d -type f -executable); do - "$hook" $errno $mbsync_args +for hook in $(find $dir/pre-sync.d -type f -name '*.hook' -executable); do + "$hook" $mbsync_args done mbsync -c "$config" $mbsync_args -errno=$? +export mbsync_errno=$? -for hook in $(find $dir/post-sync.d -type f -executable); do - "$hook" $errno $mbsync_args +for hook in $(find $dir/post-sync.d -type f -name '*.hook' -executable); do + "$hook" $mbsync_args done -exit $errno +exit $mbsync_errno