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); }); } 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'); }); });