X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/e252820a3fe76eb728d9a5e9796e1c971094e08b..b7b9def17a0f734b76f12c3c1d5441c6ba9990dd:/isync/post-sync.d/10-youtube diff --git a/isync/post-sync.d/10-youtube b/isync/post-sync.d/10-youtube index b6b0aba..0b0363c 100755 --- a/isync/post-sync.d/10-youtube +++ b/isync/post-sync.d/10-youtube @@ -1,13 +1,12 @@ #!/usr/bin/env bash -errno=$1 -mbsync_args=$* - -if [[ $errno -ne 0 ]]; then +if [[ $mbsync_errno -ne 0 ]]; then echo "mbsync failed, ignoring post-sync commands." >&2 exit fi +mbsync_args=$* + if [[ "$mbsync_args" != "gmail" ]]; then # only run for gmail account exit @@ -29,7 +28,7 @@ for maildir in "${maildirs[@]}"; do # expand tilde maildir=${maildir/#~/$HOME} - if [[ -d "$maildir/$yt_src_mb" ]]; then + if [[ ! -d "$maildir/$yt_src_mb" ]]; then echo "No mailbox at '$maildir/$yt_src_mb'" continue fi