forked from pimatic/pimatic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpimatic.js
More file actions
executable file
·32 lines (27 loc) · 784 Bytes
/
pimatic.js
File metadata and controls
executable file
·32 lines (27 loc) · 784 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
#!/usr/bin/env node
process.umask(0);
require('./coffee-cache.js')
var path = require('path');
var init = require('./lib/daemon');
var semver = require('semver');
if(semver.lt(process.version, '4.0.0')) {
console.log("Error: Your node.js version " + process.version + " is too old. "
+ "Please update node.js to version >=4.0.0 and run pimatic again. See you again.");
process.exit(1);
}
run = function () {
require('./startup').startup().done();
};
var command = process.argv[2];
if(!command || command === "run") {
run();
} else {
logFile = path.resolve(__dirname, '../../pimatic-daemon.log');
pidFile = path.resolve(__dirname, '../../pimatic.pid');
init.simple({
pidfile: pidFile,
logfile: logFile,
command: process.argv[3],
run: run
});
}