forked from MA3LLOMA/maleficent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (22 loc) 路 722 Bytes
/
Copy pathindex.js
File metadata and controls
22 lines (22 loc) 路 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
console.log('馃晵 Starting Maleficent . . .');
const path = require('path');
const { spawn } = require('child_process');
const start = () => {
const p = spawn(process.argv[0], [path.join(__dirname, 'main.js'), ...process.argv.slice(2)], {
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
})
.on('message', data => {
if (data === 'reset') {
console.log('馃晵 Restarting Maleficent . . .');
p.kill()
}
if (data === 'uptime') {
p.send(process.uptime())
}
})
.on('exit', code => {
console.log('Exited with code:', code);
start()
});
};
start()