refactor(daemon): share runtime and service probe helpers
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { isBunRuntime, isNodeRuntime } from "./runtime-binary.js";
|
||||
|
||||
type GatewayProgramArgs = {
|
||||
programArguments: string[];
|
||||
@@ -8,16 +9,6 @@ type GatewayProgramArgs = {
|
||||
|
||||
type GatewayRuntimePreference = "auto" | "node" | "bun";
|
||||
|
||||
function isNodeRuntime(execPath: string): boolean {
|
||||
const base = path.basename(execPath).toLowerCase();
|
||||
return base === "node" || base === "node.exe";
|
||||
}
|
||||
|
||||
function isBunRuntime(execPath: string): boolean {
|
||||
const base = path.basename(execPath).toLowerCase();
|
||||
return base === "bun" || base === "bun.exe";
|
||||
}
|
||||
|
||||
async function resolveCliEntrypointPathForService(): Promise<string> {
|
||||
const argv1 = process.argv[1];
|
||||
if (!argv1) {
|
||||
|
||||
Reference in New Issue
Block a user