From cd40b5d691ca884b00acfc628274765db9540854 Mon Sep 17 00:00:00 2001 From: vmarchaud Date: Tue, 27 Jun 2017 21:24:31 +0200 Subject: [PATCH 1/2] (daemon) allow to overide signal used to kill process #2976 --- lib/God/Methods.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/God/Methods.js b/lib/God/Methods.js index 09765683..e7b8e9fa 100644 --- a/lib/God/Methods.js +++ b/lib/God/Methods.js @@ -213,14 +213,14 @@ module.exports = function(God) { if (pm2_env.treekill !== true) { try { - process.kill(parseInt(pid), 'SIGINT'); + process.kill(parseInt(pid), process.env.PM2_KILL_SIGNAL || 'SIGINT'); } catch(e) { console.error('[SimpleKill] %s pid can not be killed', pid, e.stack, e.message); } return God.processIsDead(pid, pm2_env, cb); } else { - treekill(parseInt(pid), 'SIGINT', function(err) { + treekill(parseInt(pid), process.env.PM2_KILL_SIGNAL || 'SIGINT', function(err) { return God.processIsDead(pid, pm2_env, cb); }); } From f914f306a033e9282526f8c8e72b6b3b2baa49c3 Mon Sep 17 00:00:00 2001 From: vmarchaud Date: Tue, 27 Jun 2017 21:35:03 +0200 Subject: [PATCH 2/2] (module) allow to pm2 install module with git+http url #2973 --- lib/Utility.js | 9 +++++++++ test/interface/utility.mocha.js | 2 ++ 2 files changed, 11 insertions(+) diff --git a/lib/Utility.js b/lib/Utility.js index 4e0c01e9..87c6b1b8 100644 --- a/lib/Utility.js +++ b/lib/Utility.js @@ -179,6 +179,11 @@ var Utility = module.exports = { } } } + + //pm2 install git+https://github.com/user/module + if(canonic_module_name.indexOf('git+') !== -1) { + canonic_module_name = canonic_module_name.split('/').pop(); + } //pm2 install username/module else if(canonic_module_name.indexOf('/') !== -1) { @@ -194,6 +199,10 @@ var Utility = module.exports = { if(canonic_module_name.indexOf('#') !== -1) { canonic_module_name = canonic_module_name.split('#')[0]; } + + if (canonic_module_name.indexOf('.git') !== -1) { + canonic_module_name = canonic_module_name.replace('.git', ''); + } return canonic_module_name; } diff --git a/test/interface/utility.mocha.js b/test/interface/utility.mocha.js index 4145a488..0c42b351 100644 --- a/test/interface/utility.mocha.js +++ b/test/interface/utility.mocha.js @@ -19,6 +19,8 @@ describe('Utility', function() { assert(Utility.getCanonicModuleName('ma-zal/pm2-slack#own-branch') === 'pm2-slack'); assert(Utility.getCanonicModuleName('pm2-slack') === 'pm2-slack'); assert(Utility.getCanonicModuleName('@org/pm2-slack') === 'pm2-slack'); + assert(Utility.getCanonicModuleName('git+https://github.com/user/pm2-slack') === 'pm2-slack'); + assert(Utility.getCanonicModuleName('git+https://github.com/user/pm2-slack.git') === 'pm2-slack'); }); });