(startup) launchd auto restart + unstartup launchd

This commit is contained in:
Unitech 2016-12-06 16:31:01 +01:00
parent e3e5938c43
commit 0ec275af69

View File

@ -97,16 +97,24 @@ module.exports = function(CLI) {
'rm /etc/init.d/pm2'
];
break;
case 'launchd':
var destination = path.join(process.env.HOME, 'Library/LaunchAgents/PM2.plist');
commands = [
'launchctl remove com.PM2',
'rm ' + destination
];
};
shelljs.exec(commands.join('; '), function(err, stdout, stderr) {
shelljs.exec(commands.join('; '), function(code, stdout, stderr) {
console.log(stdout);
console.log(stderr);
if (err) {
Common.printError(err);
return cb(Common.retErr(err));
if (code == 0) {
Common.printOut(cst.PREFIX_MSG + chalk.bold('Init file disabled.'));
}
cb();
cb(null, {
commands : commands,
platform : platform
});
});
};