Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var execute = function(table) {
  2.     var gh = new GitHub({
  3.        username: config.username,
  4.        password: config.password
  5.     });
  6.     var db = gh.getRepo(config.username, config.repo);
  7.     console.log(db);
  8.     options = {
  9.         name: config.name,
  10.         email: config.email,
  11.         encode: false
  12.     }
  13.     db.writeFile(config.branch, "new_file", btoa("new_file content"), "added new_file", options).then(
  14.         function(succ) {
  15.             // GitHub.bundle.js:1065 Uncaught (in promise) TypeError: Cannot read property '__currentTree' of undefined
  16.             db.move(config.branch, "new_file", "new_fn").then(
  17.                 function(succ) {
  18.                     console.log(succ);
  19.                 }, function(fail) {
  20.                     console.log("failure");
  21.                     console.log(fail);
  22.                 }
  23.             )
  24.         }, function(fail) {
  25.             console.log(fail);
  26.         }
  27.     );
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement