trigger.dev
Version:
A Command-Line Interface for Trigger.dev (v3) projects
24 lines • 713 B
JavaScript
import { spawn } from "child_process";
import { logger } from "./logger.js";
export const isLinuxServer = async () => {
if (process.platform !== "linux") {
return false;
}
const xdgAvailable = await new Promise((res) => {
const xdg = spawn("xdg-open");
xdg.on("error", (error) => {
logger.debug("Error while checking for xdg-open", error);
res(false);
});
xdg.on("spawn", () => {
res(true);
});
xdg.on("exit", (code) => {
res(code === 0);
});
xdg.unref();
});
logger.debug("xdg-open available:", xdgAvailable);
return !xdgAvailable;
};
//# sourceMappingURL=linux.js.map