| 124 | * Write a full config object to a file. |
| 125 | */ |
| 126 | export const writeConfig = ( |
| 127 | path: string, |
| 128 | config: ExecutorFileConfig, |
| 129 | ): Effect.Effect<void, ConfigWriteError | PlatformError, FileSystem.FileSystem> => |
| 130 | Effect.gen(function* () { |
| 131 | const fs = yield* FileSystem.FileSystem; |
| 132 | const text = yield* Effect.try({ |
| 133 | try: () => JSON.stringify(config, null, 2) + "\n", |
| 134 | catch: (cause) => new ConfigWriteError(path, cause), |
| 135 | }); |
| 136 | yield* fs.writeFileString(path, text); |
| 137 | }); |
| 138 | |
| 139 | /** |
| 140 | * Add secret metadata to the config file. |