Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add execPath and nodeOptions in service config #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion lib/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,19 @@ var daemon = function(config) {
value: config.logpath || homedir + '/Library/Logs/' + (this.name || config.name || 'node-scripts')
},

/**
* @cfg {String} execPath
* The absolute path to the executable that will launch the script.
* If omitted process.execPath is used.
*/
execPath: {
enumerable: true,
writable: true,
configurable: false,
value: config.execPath !== undefined ? require('path').resolve(config.execPath) : process.execPath
},


/**
* @cfg {Number} [maxRetries=null]
* The maximum number of restart attempts to make before the service is considered non-responsive/faulty.
Expand All @@ -237,6 +250,17 @@ var daemon = function(config) {
value: config.maxRestarts || 3
},

/**
* @cfg {string} [nodeOptions='--harmony']
* Options to be passed to the node process.
*/
nodeOptions: {
enumerable: true,
writable: false,
configurable: false,
value: config.nodeOptions || '--harmony'
},

/**
* @cfg {Boolean} [abortOnError=false]
* Setting this to `true` will force the process to exit if it encounters an error that stops the node.js script from running.
Expand Down Expand Up @@ -317,7 +341,9 @@ var daemon = function(config) {
}
// Build the plist file
var args = [
process.execPath,'--harmony',wrapper,
me.execPath,
me.nodeOptions,
wrapper,
'-f',me.script,
'-l',me.outlog,
'-e',me.errlog,
Expand Down