Closed
Description
I tried running the following simple code:
var github = new Github({ token: ".....<keyhere>.....", auth: "oauth"});
var repo = github.getRepo("Pomax", "pomax.github.io");
repo.contents("master", "gh-weblog/content", function(err, result) { console.warn(err); console.log(result); }, true);
repo.remove("master", "gh-weblog/content/2013-10-31-11-26-36.json", function(err, result) { console.log(err, result); });
But this generates one error after another. The path handling in remove is not in line with the v3 API, in browser context the global vars are getting set wrong:
- _ ends up being unknown on line 407, despite underscore having loaded
- XMLHttpRequest gets overwritten in function scope rather than using
var XMLHTTPRequest = (typeof XMLHTTPRequest === "undefined" ? false : XMLHTTPRequest);
) - Base64 is not necessary at all in browser context (the atob() function already exists)
Even fixing those things, I get errors that the update call to git/trees is missing sha values; dir entires should have sha values as well, so I removed the filter that takes them out, and then the github API still throws up errors, so there are some problems here that prevent github.js from being usable with the API v3.
Metadata
Metadata
Assignees
Labels
No labels