forked from Superalgos/Superalgos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.js
59 lines (53 loc) · 2.13 KB
/
setup.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const path = require("path");
const process = require("process");
const { exec } = require("child_process");
// Handle adding shortcuts
if (process.argv.includes("noShortcuts")) {
// Cancel running script if flag provided
console.log('');
console.log('noShortcuts ................................................... Setting up without shortcuts.')
} else {
// Run create-shortcuts script
try {
const { fork } = require('child_process')
fork('./Launch-Scripts/create-shortcut.js')
} catch (err) {
console.log('')
console.log(err)
console.log('')
}
}
// Create Operating System compatable paths to each node_modules directory.
let nodeModulesDirs = [
path.join( process.cwd(), "Client"),
path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Sensor-Bot", "Exchange-Raw-Data"),
path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "API-Data-Fetcher-Bot"),
path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Announcements"),
path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Low-Frequency-Trading", "APIs"),
path.join( process.cwd(), "Projects", "Superalgos", "TS", "Task-Modules"),
path.join( process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules", "Learning-Bot", "Low-Frequency-Learning")
];
console.log('');
console.log("Installing node dependencies at the following directories:");
console.log('');
console.log(nodeModulesDirs);
console.log('');
for (let dir of nodeModulesDirs) {
// Loop through directories and run npm ci in a child process shell.
let command = "echo Results of install at "+ dir + " & npm ci";
exec( command,
{
cwd: dir
},
function ( error, stdout ){
if (error) {
console.log('');
console.log("There was an error installing some dependencies error: ");
console.log('');
console.log( error );
return;
}
console.log('');
console.log( stdout );
});
};