-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·52 lines (47 loc) · 1.03 KB
/
index.js
File metadata and controls
executable file
·52 lines (47 loc) · 1.03 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
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env node
const Listr = require("listr");
const f = require("./functions");
//
// Flow:
// - get info from json file : token, url, DAO addresses
// - `yarn backend`
// - await `node bin/sourcecred.js discourse https://discourse.sourcecred.io`
// - await `node bin/sourcecred.js scores discourse.sourcecred.io`
// - format grain
// - Save grain to json file
// - display grain
// - Ask to mint
// - Mint
//
//const config = require("../scores.json");
const run = async () => {
const forum = await f.getInput()
const tasks = new Listr([
{
title: "Run Backend",
task: async () => {
await f.startBackend();
},
},
{
title: "Run SourceCred",
task: async () => {
await f.runSC(forum);
},
},
{
title: "Calc Grain",
task: async () => {
console.log(await f.calcCred(forum));
},
},
{
title: "saveCSV",
task: async () => {
await f.processCSV();
},
},
]);
tasks.run();
};
run();