From 6ce7bc5cf278abd4f2aecc3c5fd8f26780322398 Mon Sep 17 00:00:00 2001 From: John Kane Date: Tue, 13 Aug 2013 21:44:19 +0100 Subject: [PATCH] Add command line docs. --- TODO.md | 2 +- src/leiningen/s3_sync.clj | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 4100f26..3456f46 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,7 @@ TODO * [X] Figure out project config details * [X] Better console output * [X] Allow specifying the bucket/local dir from command line -* [ ] Document usage +* [X] Document usage Bugs ---- diff --git a/src/leiningen/s3_sync.clj b/src/leiningen/s3_sync.clj index 8918832..d46cb9a 100644 --- a/src/leiningen/s3_sync.clj +++ b/src/leiningen/s3_sync.clj @@ -9,7 +9,23 @@ (def padding " ") -(defn s3-sync [project & keys] +(defn s3-sync + "Synchronise a directory with a bucket on Amazon's S3. + + The sync is operates recursively within the local + file directory. Files are compared by MD5 hash with + their remote equivalent and pushed if it does not + exist or has been changed locally. The synchonisation + is controlled by config specified on the command line + or in the project.clj: + + :s3-sync {:access-key \"XXX\" + :secret-key \"XXX\" + :bucket \"my-bucket\" + :local-dir \"out/public\"} + + The bucket name given must exist and be accessible." + [project & keys] (let [[valid config errors] (cl/resolve-config project keys)] (if (not valid) (lein/abort (first errors))