['--stop',`Stop the ${process.platform} OS services.`],
['--stop',`Stop the ${process.platform} OS services.`],
['--start',`Start the ${process.platform} OS services (the default).`],
['--start',`Start the ${process.platform} OS services (the default).`],
['--noexit',`When used in other commands, don't call process.exit.`],
['--noexit',`When used in other commands, don't call process.exit.`],
['--os','Force the process.platform to specific one']
['--os <platform>','Force the process.platform to specific one']
]
]
constwindows=(opts)=>{
constwindows=(opts)=>{
@ -20,10 +20,6 @@ const windows = (opts) => {
}
}
}
}
constlinux=(opts)=>{
console.error("ERROR: linux isn't supported yet. Sorry!");
}
constdarwin=(opts)=>{
constdarwin=(opts)=>{
if(opts.stop){
if(opts.stop){
console.log("Stopping pm2...");
console.log("Stopping pm2...");
@ -35,6 +31,15 @@ const darwin = (opts) => {
}
}
}
}
constlinux=(opts)=>{
if(opts.os==="linux"){
darwin(opts);
}else{
console.error("On Linux you should run redis-server using systemctl or similar. If you really want to use pm2 to manage redis then rerun this command with: --os linux");