-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (27 loc) · 762 Bytes
/
index.js
File metadata and controls
29 lines (27 loc) · 762 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
29
const patch = require('./globals/patch')
const commands = require('./globals/commands')
const tasks = require('./globals/tasks')
const { log, warn } = require('./globals/logger')
const rub = require('./globals/rub')
const globals = require('./globals/index')
process.on('unhandledRejection', (error, promise) => {
console.error('== Node detected an unhandled rejection! ==')
console.error(error.stack)
});
(async () => {
try {
await globals.initialize()
await patch.initialize()
commands.load('./commands/index')
await commands.loaded()
await tasks.perform()
if (tasks.isWaiting) return
log('Finished.')
} catch (err) {
if (rub.failText) {
warn(rub.failText)
}
console.log(err)
process.exit()
}
})()