( fs: FileSystem.FileSystem, path: string, )
| 25 | |
| 26 | /** Read the raw JSONC text from a config file, or create a default one. */ |
| 27 | const readOrCreate = ( |
| 28 | fs: FileSystem.FileSystem, |
| 29 | path: string, |
| 30 | ): Effect.Effect<string, PlatformError> => |
| 31 | Effect.gen(function* () { |
| 32 | const exists = yield* fs.exists(path); |
| 33 | if (exists) return yield* fs.readFileString(path); |
| 34 | yield* fs.writeFileString(path, DEFAULT_CONFIG); |
| 35 | return DEFAULT_CONFIG; |
| 36 | }); |
| 37 | |
| 38 | /** |
| 39 | * Add an integration entry to the config file. Creates the file if it doesn't exist. |
no outgoing calls
no test coverage detected