1.0.0 • Published 3 years ago
@cebecifaruk/jstart v1.0.0
/usr/lib/systemd tells you you're on a systemd based system. /usr/share/upstart is a pretty good indicator that you're on an Upstart-based system. /etc/init.d tells you the box has SysV init in its history
async detectInit() { if (process.platform === "win32") return "windows"; if (process.platform === "darwin") return "launchd"; if (process.platform === "freebsd") return null; if (process.platform === "openbsd") return null; if (process.platform === "linux") {
} initSystem = initSystem === "" ? await spin("Detecting init system.", commmands.detectInit()) : initSystem;
// Linux
switch (initSystem) {
case "windows":
case "launchd":
case "systemv":
case "systemd":
case "openrc":
case "runit":
case "initrc":
default:
red("Unsupported init system.");
gray("You can add jserve to your init system manually");
gray("Just run this command when system has been boot up:");
gray("jserve");
return;
}
// childProcess.fork(
// path.join(path.dirname(url.fileURLToPath(import.meta.url)), "cli.js"),
// {
// cwd: "/",
// }
// );§
1.0.0
3 years ago