Fix install specific version

Like: `pm2 install module@2.1.0-beta`
Remove `force` option from rm, not needed and dangerous
This commit is contained in:
Antoine Bluchet 2015-09-06 02:30:34 +02:00
parent 5c0b57826b
commit df62d2ceca

View File

@ -145,6 +145,10 @@ function installModule(module_name, cb) {
if (module_name.indexOf('/') != -1)
module_name = module_name.split('/')[1];
//pm2 install module@2.1.0-beta
if(module_name.indexOf('@') != -1)
module_name = module_name.split('@')[0]
proc_path = p.join(cst.PM2_ROOT_PATH, 'node_modules', module_name);
@ -174,14 +178,14 @@ function uninstallModule(module_name, cb) {
if (module_name != '.') {
console.log(proc_path);
shelljs.rm('-rf', proc_path);
shelljs.rm('-r', proc_path);
}
return cb(err);
}
if (module_name != '.') {
shelljs.rm('-rf', proc_path);
shelljs.rm('-r', proc_path);
}
return cb();