-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathglitch-sync.js
More file actions
41 lines (32 loc) · 1.05 KB
/
glitch-sync.js
File metadata and controls
41 lines (32 loc) · 1.05 KB
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
debug = true;
var config = require('./node_modules/api-keys/sync-config-slack.json');
var colors = require('colors');
const { exec } = require('child_process');
var command = "";
var debug = true;
//Making the command, env vars need to be first to have sync work correctly
command += "GLITCH_PROJECT_ID='" + config.projectID + "' ";
command += "GLITCH_TOKEN='" + config.authorization + "' ";
command += "GH_REPO='" + config.repo + "' ";
if (debug) {
command += " DEBUG=sync-glitch* ";
}
command += "./node_modules/.bin/sync-glitch";
var dataCallback = function(data) {
console.log(data);
};
console.log(command.dim);
exec(command, (err, stdout, stderr) => {
if (err) {
console.log("Error: could not run command, make sure that sync-config is correct".red);
return;
}
//if statements needed to prevent extra lines if no error or out
if (stdout !== "") {
console.log(stdout.green + ' repo: ' + config.repo.bold);
}
if (stderr !== "") {
console.log(stderr.red);
}
console.log("Done".green);
});