Skip to content

Commit

Permalink
Add delete-contents, similar to the existing update-contents
Browse files Browse the repository at this point in the history
GitHub API docs that describe this feature are here:

https://developer.github.com/v3/repos/contents/#delete-a-file
  • Loading branch information
joelittlejohn committed Jan 7, 2016
1 parent 0122d73 commit 0c00ec4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/tentacles/repos.clj
Expand Up @@ -474,6 +474,21 @@
options)]
(api-call :put "repos/%s/%s/contents/%s" [user repo path] body)))

(defn delete-contents
"Delete a file in a repository
path -- The content path.
message -- The commit message.
sha -- The blob SHA of the file being deleted.
Options are:
branch -- The branch name. Default: the repository’s default branch (usually master)
author -- A map containing :name and :email for the author of the commit
committer -- A map containing :name and :email for the committer of the commit"
[user repo path message sha & [options]]
(let [body (merge {:message message
:sha sha}
options)]
(api-call :delete "repos/%s/%s/contents/%s" [user repo path] body)))

(defn archive-link
"Get a URL to download a tarball or zipball archive for a repository.
Options are:
Expand Down

0 comments on commit 0c00ec4

Please sign in to comment.