]> git.madduck.net Git - etc/offlineimap.git/blobdiff - .bin/offlineimap

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

do not run if metadata directory does not exist
[etc/offlineimap.git] / .bin / offlineimap
index a1d7f96229509c63da8d44def38dbbec4c33c646..9d68f9183672f77cdaee410f3ef56111f0b43c5e 100755 (executable)
@@ -2,6 +2,7 @@
 set -eu
 
 VAR=$HOME/.var/offlineimap
+DEFAULT_ACCOUNT=madduck.net
 
 opts=
 accounts=
@@ -18,12 +19,11 @@ for opt in "$@"; do
   esac
 done
 
-info() { [ -n "$quiet" ] || echo >&2 "$@"; }
+say() { [ -n "$quiet" ] || echo >&2 "$@"; }
 err() { echo >&2 "$@"; }
 
 if [ -z "$accounts" ]; then
-  err "E: no account(s) specified…"
-  exit 1
+  accounts=$DEFAULT_ACCOUNT
 else
   accounts=$(echo "$accounts" | sed -e 's/,/ /g')
 fi
@@ -53,6 +53,11 @@ for account in $accounts; do
     continue
   }
 
+  [ -d $VAR/$account ] || {
+    err "E: $VAR/$account does not exist, please create it first."
+    continue
+  }
+
   eval /usr/bin/offlineimap -a $account -k metadata=$VAR/$account $opts || \
     failures=$(($failures + 1))