mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
Added --watch option to start command
This commit is contained in:
parent
6fb6cc5624
commit
65fa45ba98
1
bin/pm2
1
bin/pm2
@ -70,6 +70,7 @@ function failOnUnknown(fn) {
|
||||
//
|
||||
commander.command('start <script|json_file|stdin(-)>')
|
||||
.description('start specific processes')
|
||||
.option('--watch', 'Watch folder for changes')
|
||||
.action(function(cmd) {
|
||||
if (cmd == "-") {
|
||||
process.stdin.resume();
|
||||
|
||||
@ -77,6 +77,9 @@ CLI.startFile = function(script) {
|
||||
fs.writeFileSync(dst_path, JSON.stringify(appConf));
|
||||
}
|
||||
|
||||
if(commander.rawArgs.indexOf('--watch') !== -1)
|
||||
appConf['watch'] = true;
|
||||
|
||||
/*
|
||||
* Re start script name that is already launched
|
||||
*/
|
||||
@ -151,6 +154,9 @@ CLI.startFromJson = function(cmd,jsonVia) {
|
||||
var appConf = JSON.parse(data);
|
||||
}
|
||||
|
||||
if(commander.rawArgs.indexOf('--watch') !== -1)
|
||||
appConf['watch'] = true;
|
||||
|
||||
if (!Array.isArray(appConf)) appConf = [appConf]; //convert to array
|
||||
|
||||
(function ex(apps) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user