Skip to content

Commit

Permalink
Add command line docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Kane committed Aug 13, 2013
1 parent 2a2aa49 commit 6ce7bc5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----
Expand Down
18 changes: 17 additions & 1 deletion src/leiningen/s3_sync.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6ce7bc5

Please sign in to comment.