forked from KeenanSegenchuk/UptonAir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
41 lines (35 loc) · 1.04 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {GitHub} from "./github-js/lib/GitHub.js";
export function test(input, user, pass)
{
/*
const fs = require('fs');
const readline = require('readline');
//init file stream
const readStream = fs.createReadStream("test.txt",
function(err) {if(err) {alert("Cannot read " + "test.txt");}});
const readInterface = readline.createInterface({
input: readStream,
output: process.stdout,
console: false});
//read file
var text = "";
readInterface.on('line', function(line){
text = text + line + "\n";
});
text = text + input;*/
text = input;
//github stuff
var github = new GitHub({
username: user,
password: pass,
auth: "basic"
});
var repo = github.getRepo("KeenanSegenchuk", "UptonAir");
repository.write(
"master",
"test.txt",
text,
"test commit via api",
function(err){if(err){alert("err")}}
);
}