Skip to content

Commit

Permalink
Send repo link to browser (#9).
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Oct 12, 2013
1 parent 429bffd commit a6ea3b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contributions.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ module.exports = {
console.log(new Date(options.dates[i] * 1000));
}

var repoName = "/public/repos/" + Math.random().toString(36).substring(3);
var repoName = "public/repos/" + Math.random().toString(36).substring(3);
runCommand("sh " + __dirname + "/bin/create-repository.sh " + process.cwd() + " " + repoName, function () {
console.log("Created");
var ID = 0;
(function makeCommit (date) {
if (!date || isNaN(date)) {
console.log("Date is: ", date, "ID: ", ID);
callback(null, "[TODO generated repo URL]");
callback(null, repoName);
//process.exit(1); ???
return;
}
Expand Down
2 changes: 2 additions & 0 deletions public/repos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ http.createServer(function(req, res) {
}


Contributions.getRepo(formData, function (err, repoData) {
Contributions.getRepo(formData, function (err, repoLink) {
if (err) { return sendResponse(req, res, err, 400); }
sendResponse(req, res, repoData);
repoLink = repoLink.substring(6);
sendResponse(req, res, repoLink);
});

});
Expand Down

0 comments on commit a6ea3b4

Please sign in to comment.