From 6862ad5f571450be7134397df7d6c43d21ed3f36 Mon Sep 17 00:00:00 2001 From: indexzero Date: Wed, 16 Feb 2011 03:17:14 -0500 Subject: [PATCH] [api] Expose options passed to child_process.spawn --- lib/forever/monitor.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/forever/monitor.js b/lib/forever/monitor.js index 9e859161..e39702c3 100644 --- a/lib/forever/monitor.js +++ b/lib/forever/monitor.js @@ -23,18 +23,19 @@ var sys = require('sys'), var Monitor = exports.Monitor = function (script, options) { events.EventEmitter.call(this); - this.silent = options.silent || false; - this.forever = options.forever || false; - this.command = options.command || 'node'; - this.sourceDir = options.sourceDir; - this.options = options.options || []; - this.max = options.max; - this.logFile = options.logFile; - this.pidFile = options.pidFile; - this.outFile = options.outFile; - this.errFile = options.errFile; - this.logger = options.logger || new (winston.Logger)({ - transports: [new winston.transports.Console()] + this.silent = options.silent || false; + this.forever = options.forever || false; + this.command = options.command || 'node'; + this.sourceDir = options.sourceDir; + this.options = options.options || []; + this.spawnWith = options.spawnWith || null; + this.max = options.max; + this.logFile = options.logFile; + this.pidFile = options.pidFile; + this.outFile = options.outFile; + this.errFile = options.errFile; + this.logger = options.logger || new (winston.Logger)({ + transports: [new winston.transports.Console({ silent: this.silent })] }); // Extend from the winston logger. @@ -161,8 +162,8 @@ Monitor.prototype.trySpawn = function () { return false; } } - - return spawn(this.command, this.options); + + return spawn(this.command, this.options, this.spawnWith); }; //