Credit to @bustardcelly and grunt-forever, which this plugin is forked from / based on. This is just that but as a multi task, with a bug or two fixed, and some added features. https://github.com/bustardcelly/grunt-forever
This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-forever-multi --save-dev
foreverMulti:basic:file: 'test/run.js'appServer:action: 'restart'file: 'test/run.js'options: "-m '"+cfgJsonappname+" port "+cfgJsonserverport+"'"testServer:// action: 'restart', //default is restart if no action specifiedfile: 'test/run.js'options: "config=test" "-m '"+cfgTestJsonappname+" port "+cfgTestJsonserverport+"'"
actionto override the action (i.e.
--action=startwill run the forever start action even if the task config is set to
# run all tasks in this multiTask with their defaults / standard configgrunt foreverMulti# force a forever restart irregardless of what the config action isgrunt foreverMulti --action=restart# run just one of the tasksgrunt foreverMulti:appServer
The options / keys for each task mimic forever-monitor/forever: https://github.com/nodejitsu/forever-monitor including
action keys. The only supported options currently are:
fileThe file/script to run (i.e.
actionWhat to run forever with - see: https://npmjs.org/package/forever. Only
stopare supported currently.
optionsCommand line arguments to pass to forever
Other options including, but not limited to,
errFile are NOT currently supported.
See https://npmjs.org/doc/developers.html for notes on publishing npm modules in general.
gruntto ensure no issues
CHANGELOG.md(and potentially this
forever.startDaemonis called but grunt finishes WITHOUT
done()being called (from
this.async()) - this causes the script to exit - sometimes before the forever process is started and it stops future execution of any other tasks in the multi-task.. I'm not sure what's going on here or how to fix..