From 8d6e7aebe3f2b14508ad3e7eeacd87f9ab3425cb Mon Sep 17 00:00:00 2001 From: Tjatse Date: Mon, 24 Nov 2014 17:16:26 +0800 Subject: [PATCH] 1. add `post_update` schema; 2. fix log path bug. --- lib/Common.js | 9 ++++----- lib/schema.json | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Common.js b/lib/Common.js index 1f9465de..4b811cc8 100644 --- a/lib/Common.js +++ b/lib/Common.js @@ -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'] }); diff --git a/lib/schema.json b/lib/schema.json index 39489e1b..85907fab 100644 --- a/lib/schema.json +++ b/lib/schema.json @@ -110,5 +110,8 @@ }, "force": { "type": "boolean" + }, + "post_update": { + "type": "array" } }