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

Function removeSecretFromConfig

packages/core/config/src/write.ts:162–179  ·  view source on GitHub ↗
(
  path: string,
  secretId: string,
)

Source from the content-addressed store, hash-verified

160 * Remove secret metadata from the config file.
161 */
162export const removeSecretFromConfig = (
163 path: string,
164 secretId: string,
165): Effect.Effect<void, PlatformError, FileSystem.FileSystem> =>
166 Effect.gen(function* () {
167 const fs = yield* FileSystem.FileSystem;
168
169 const exists = yield* fs.exists(path);
170 if (!exists) return;
171
172 let text = yield* fs.readFileString(path);
173 const edits = jsonc.modify(text, ["secrets", secretId], undefined, {
174 formattingOptions: FORMATTING,
175 });
176 text = jsonc.applyEdits(text, edits);
177
178 yield* fs.writeFileString(path, text);
179 });

Callers 1

config.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected