We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5283017 commit 5c9c83fCopy full SHA for 5c9c83f
github.js
@@ -544,7 +544,24 @@
544
});
545
546
};
547
-
+
548
+ // Delete a file from the tree
549
+ // -------
550
551
+ this.delete = function(branch, path, cb) {
552
+ that.getSha(branch, path, function(err, sha) {
553
+ if (!sha) return cb("not found", null);
554
+ var delPath = repoPath + "/contents/" + path;
555
+ var params = {
556
+ "message": "Deleted " + path,
557
+ "sha": sha
558
+ };
559
+ delPath += "?message=" + encodeURIComponent(params.message);
560
+ delPath += "&sha=" + encodeURIComponent(params.sha);
561
+ _request("DELETE", delPath, null, cb);
562
+ })
563
+ }
564
565
// Move a file to a new location
566
// -------
567
0 commit comments