MCPcopy Create free account
hub / github.com/cloudflare/computer / configSetWith

Function configSetWith

packages/computer/src/git/plumbing.ts:266–282  ·  view source on GitHub ↗
(opts: ConfigSetWithDeps)

Source from the content-addressed store, hash-verified

264}
265
266export async function configSetWith(opts: ConfigSetWithDeps): Promise<void> {
267 const dir = opts.dir ?? "/";
268 try {
269 await opts.git.setConfig({
270 fs: opts.fs,
271 dir,
272 path: opts.path,
273 value: opts.value,
274 append: opts.append,
275 });
276 } catch (cause) {
277 if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause });
278 throw new GitError("ECONFIGFAIL", `git config failed: ${errorMessage(cause)}`, {
279 cause,
280 });
281 }
282}
283
284function errorMessage(cause: unknown): string {
285 if (cause instanceof Error) return cause.message;

Callers 2

configSetFunction · 0.85
plumbing.test.tsFile · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
setConfigMethod · 0.80
errorMessageFunction · 0.70

Tested by

no test coverage detected