-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun-cli.js
More file actions
executable file
·36 lines (29 loc) · 924 Bytes
/
Copy pathrun-cli.js
File metadata and controls
executable file
·36 lines (29 loc) · 924 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
30
31
32
33
34
35
36
#!/usr/bin/env node
'use strict';
var forever = require('forever-monitor');
var logger = require('./lib/logger');
var path = require('path');
var pkg = require('./package.json');
var cliProcess = new (forever.Monitor)(path.join(__dirname, 'cli.js'), {
max: 1000,
minUptime: 10000,
options: process.argv.slice(2)
});
cliProcess.on('error', function (err) {
logger.error('Error caused ' + pkg.name + ' to crash.');
logger.error('Please report this to ' + pkg.bugs.url);
logger.error(err);
logger.info();
logger.info();
});
cliProcess.on('restart', function () {
logger.warn('It is likely that an error caused ' + pkg.name + ' to crash.');
logger.warn('Please report this to ' + pkg.bugs.url);
logger.warn(pkg.name + ' restarted.');
logger.info();
logger.info();
});
cliProcess.on('exit', function () {
logger.info(pkg.name + ' stopped.');
});
cliProcess.start();