|
1 |
| -// Github.js 0.1.1 |
2 |
| -// (c) 2012 Michael Aufreiter, Development Seed |
3 |
| -// Github.js is freely distributable under the MIT license. |
4 |
| -// For all details and documentation: |
5 |
| -// http://substance.io/michael/github |
| 1 | +// Github.js 0.1.2 |
| 2 | +// (c) 2012 Michael Aufreiter, Development Seed |
| 3 | +// Github.js is freely distributable under the MIT license. |
| 4 | +// For all details and documentation: |
| 5 | +// http://substance.io/michael/github |
6 | 6 |
|
7 | 7 | (function() {
|
8 | 8 | var Github;
|
|
116 | 116 | // Create a new commit object with the current commit SHA as the parent
|
117 | 117 | // and the new tree SHA, getting a commit SHA back
|
118 | 118 |
|
119 |
| - function createCommit(parent, tree, cb) { |
| 119 | + function createCommit(parent, tree, message, cb) { |
120 | 120 | var data = {
|
121 |
| - "message": "Spooky. Isn't it?", |
| 121 | + "message": message, |
122 | 122 | "author": {
|
123 |
| - "name": "Ghost" |
| 123 | + "name": username |
124 | 124 | },
|
125 | 125 | "parents": [
|
126 | 126 | parent
|
|
195 | 195 | // Write file contents on a given path
|
196 | 196 | // -------
|
197 | 197 |
|
198 |
| - this.write = function(path, content, cb) { |
| 198 | + this.write = function(path, content, message, cb) { |
199 | 199 | getLatestCommit(function(err, latestCommit) {
|
200 | 200 | getTree(latestCommit, function(err, tree) {
|
201 | 201 | postBlob(content, function(err, blob) {
|
202 | 202 | postTree(tree, path, blob, function(err, tree) {
|
203 |
| - createCommit(latestCommit, tree, function(err, commit) { |
| 203 | + createCommit(latestCommit, tree, message, function(err, commit) { |
204 | 204 | updateHead(commit, function(err) {
|
205 | 205 | cb(err);
|
206 | 206 | });
|
|
0 commit comments