| 53 | ) |
| 54 | |
| 55 | const withPlatform = <A, E, R>(platform: typeof process.platform, self: Effect.Effect<A, E, R>) => |
| 56 | Effect.acquireUseRelease( |
| 57 | Effect.sync(() => { |
| 58 | const original = Object.getOwnPropertyDescriptor(process, "platform") |
| 59 | Object.defineProperty(process, "platform", { |
| 60 | ...original, |
| 61 | value: platform, |
| 62 | }) |
| 63 | return original |
| 64 | }), |
| 65 | () => self, |
| 66 | (original) => |
| 67 | Effect.sync(() => { |
| 68 | if (original) Object.defineProperty(process, "platform", original) |
| 69 | }), |
| 70 | ) |
| 71 | |
| 72 | const getTuiConfig = (directory: string) => |
| 73 | TuiConfig.Service.use((svc) => svc.get()).pipe( |