Skip to content

Commit

Permalink
[minor] Small require formatting updates. Try to be more future-proof.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed May 1, 2011
1 parent 3112380 commit 0fb8abe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 2 additions & 4 deletions bin/forever
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
var path = require('path'),
fs = require('fs'),
winston = require('winston'),
sys = require('sys');
sys = require('sys'),
forever = require('./../lib/forever');

var accepts = ['start', 'stop', 'stopall', 'list', 'config', 'clear', 'set', 'cleanlogs', 'restart'], action;
if (accepts.indexOf(process.argv[2]) !== -1) {
action = process.argv.splice(2,1)[0];
}

var argv = require('optimist').boolean(['v', 'verbose', 'a', 'append', 's', 'silent']).argv;
require.paths.unshift(path.join(__dirname, '..', 'lib'));

var forever = require('forever');

var help = [
'usage: forever [action] [options] SCRIPT [script-options]',
Expand Down
4 changes: 1 addition & 3 deletions examples/multiple-processes.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require.paths.unshift(require('path').join(__dirname, '..', 'lib'));

var util = require('util'),
forever = require('forever'),
path = require('path'),
forever = require('./../lib/forever'),
script = path.join(__dirname, 'server.js');

var child1 = new (forever.Forever)(script, { 'options': [ "--port=8080"] });
Expand Down
4 changes: 4 additions & 0 deletions lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ forever.pidFilePath = function(pidFile) {
// Utility function to check to see if a pid is running
//
function checkProcess (pid, callback) {
if (!pid) {
return callback(false);
}

exec('ps ' + pid + ' | grep -v PID', function (err, stdout, stderr) {
if (err) return callback(false);
callback(stdout.indexOf(pid) !== -1);
Expand Down
2 changes: 1 addition & 1 deletion lib/forever/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Monitor.prototype.kill = function (forceStop) {
if (forceStop) {
this.forceStop = true;
}

this.child.kill();
this.emit('stop', this.childData);
}
Expand Down
File renamed without changes.

0 comments on commit 0fb8abe

Please sign in to comment.