| 950 | }; |
| 951 | |
| 952 | const makeUnsupportedBackend = (): ServiceBackend => ({ |
| 953 | platform: "unsupported", |
| 954 | automated: false, |
| 955 | install: () => |
| 956 | Effect.fail(new Error(`OS service install is not supported on ${process.platform}.`)), |
| 957 | uninstall: () => |
| 958 | Effect.fail(new Error(`OS service uninstall is not supported on ${process.platform}.`)), |
| 959 | status: () => |
| 960 | Effect.succeed({ |
| 961 | platform: "unsupported" as const, |
| 962 | registered: false, |
| 963 | running: false, |
| 964 | pid: null, |
| 965 | detail: [`OS service management is not supported on ${process.platform}.`], |
| 966 | }), |
| 967 | restart: () => |
| 968 | Effect.fail(new Error(`OS service restart is not supported on ${process.platform}.`)), |
| 969 | }); |
| 970 | |
| 971 | /** Select the service backend for the current OS. */ |
| 972 | export const getServiceBackend = (platform: NodeJS.Platform = process.platform): ServiceBackend => { |