| 939 | }; |
| 940 | |
| 941 | const makeUnsupportedBackend = (): ServiceBackend => ({ |
| 942 | platform: "unsupported", |
| 943 | automated: false, |
| 944 | install: () => |
| 945 | Effect.fail(new Error(`OS service install is not supported on ${process.platform}.`)), |
| 946 | uninstall: () => |
| 947 | Effect.fail(new Error(`OS service uninstall is not supported on ${process.platform}.`)), |
| 948 | status: () => |
| 949 | Effect.succeed({ |
| 950 | platform: "unsupported" as const, |
| 951 | registered: false, |
| 952 | running: false, |
| 953 | pid: null, |
| 954 | detail: [`OS service management is not supported on ${process.platform}.`], |
| 955 | }), |
| 956 | restart: () => |
| 957 | Effect.fail(new Error(`OS service restart is not supported on ${process.platform}.`)), |
| 958 | }); |
| 959 | |
| 960 | /** Select the service backend for the current OS. */ |
| 961 | export const getServiceBackend = (platform: NodeJS.Platform = process.platform): ServiceBackend => { |