Added --watch option to start command

This commit is contained in:
soyuka 2014-04-02 08:45:39 +02:00
parent 6fb6cc5624
commit 65fa45ba98
2 changed files with 7 additions and 0 deletions

View File

@ -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();

View File

@ -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) {