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