MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / writeConfig

Function writeConfig

packages/core/config/src/write.ts:126–137  ·  view source on GitHub ↗
(
  path: string,
  config: ExecutorFileConfig,
)

Source from the content-addressed store, hash-verified

124 * Write a full config object to a file.
125 */
126export 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.

Callers 1

config.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected