adds platform check for cli command
This commit is contained in:
parent
828cd3d864
commit
90fa98b773
1 changed files with 4 additions and 2 deletions
6
cli
6
cli
|
|
@ -8,11 +8,13 @@ var spawn = require('child_process').spawn,
|
||||||
package = require('./package.json');
|
package = require('./package.json');
|
||||||
|
|
||||||
|
|
||||||
|
var command = process.platform === 'win32' ? 'forever.cmd' : 'forever';
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
|
||||||
process.chdir(path.normalize(__dirname));
|
process.chdir(path.normalize(__dirname));
|
||||||
|
|
||||||
var child = spawn('forever', ['start', '-c', 'node', 'index.js', '-s'], {
|
var child = spawn(command, ['start', '-c', 'node', 'index.js', '-s'], {
|
||||||
env: process.env,
|
env: process.env,
|
||||||
detached: true
|
detached: true
|
||||||
});
|
});
|
||||||
|
|
@ -28,7 +30,7 @@ function stop() {
|
||||||
|
|
||||||
process.chdir(path.normalize(__dirname));
|
process.chdir(path.normalize(__dirname));
|
||||||
|
|
||||||
var child = spawn('forever', ['stop', '-c', 'node', 'index.js', '-s'], {
|
var child = spawn(command, ['stop', '-c', 'node', 'index.js', '-s'], {
|
||||||
env: process.env,
|
env: process.env,
|
||||||
detached: true
|
detached: true
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue