-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·28 lines (26 loc) · 834 Bytes
/
main.js
File metadata and controls
executable file
·28 lines (26 loc) · 834 Bytes
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
#!/usr/bin/env node
process?.argv?.length > 2 && (async () => {
const mainCLI = require('./main_cli')
const args = process.argv.slice(3).reduce((acc, curr, i, arr) => {
if (curr.startsWith('--')) {
const key = curr.slice(2);
const nextArg = arr[i + 1];
if (nextArg && !nextArg.startsWith('--')) {
acc[key] = nextArg;
arr.splice(i + 1, 1); // Remove the next argument from the array as it's already processed
} else {
acc[key] = true;
}
}
return acc;
}, {});
let config = await mainCLI( args )
// console.log('main.js', {config})
process.exit();
})() || process.exit();
// runs main_cli.js cli_train({flag: val})
module.exports = {
DriveTrain: require("./src/train"),
DriveUtils: require("./src/gdrive"),
DriveChatbot: require("./src/chatbot")
};