1. add post_update schema; 2. fix log path bug.

This commit is contained in:
Tjatse 2014-11-24 17:16:26 +08:00
parent d7aadc9bf4
commit 8d6e7aebe3
2 changed files with 7 additions and 5 deletions

View File

@ -100,14 +100,13 @@ Common.prepareAppConf = function(app, cwd, outputter) {
['log', 'out', 'error', 'pid'].forEach(function(f){
var af = app[f + '_file'], ps, ext = (f == 'pid' ? 'pid':'log'), isStd = !~['log', 'pid'].indexOf(f);
if((f == 'log' && typeof af == 'boolean' && af) || !af){
if((f == 'log' && typeof af == 'boolean' && af) || (f != 'log' && !af)){
ps = [cst['DEFAULT_' + ext.toUpperCase() + '_PATH'], formated_app_name + (isStd ? '-' + f : '') + '.' + ext];
}else{
}else if(f != 'log' || (f == 'log' && af)){
ps = [cwd, af];
}
//pm_log_path
app['pm_' + (isStd ? f.substr(0, 3) + '_' : '') + ext + '_path'] = p.resolve.apply(null, ps);
// PM2 paths
ps && (app['pm_' + (isStd ? f.substr(0, 3) + '_' : '') + ext + '_path'] = p.resolve.apply(null, ps));
delete app[f + '_file']
});

View File

@ -110,5 +110,8 @@
},
"force": {
"type": "boolean"
},
"post_update": {
"type": "array"
}
}