mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
(startup) launchd auto restart + unstartup launchd
This commit is contained in:
parent
e3e5938c43
commit
0ec275af69
@ -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
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user