View difference between Paste ID: 41XzzEMG and XEJtU4CB
SHOW: | | - or go back to the newest paste.
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
15+
            // lib.js:15 Uncaught (in promise) TypeError: Cannot read property 'then' of undefined
16-
            db.move(config.branch, "new_file", "new_fn").then(
16+
            db.deleteFile(config.branch, "new_file").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
}