MCPcopy Create free account
hub / github.com/callstack/agent-device / withExecTraceEnv

Function withExecTraceEnv

src/utils/__tests__/exec.test.ts:328–336  ·  view source on GitHub ↗
(fn: () => Promise<T>)

Source from the content-addressed store, hash-verified

326}
327
328async function withExecTraceEnv<T>(fn: () => Promise<T>): Promise<T> {
329 const previousTraceEnv = process.env.AGENT_DEVICE_EXEC_TRACE;
330 process.env.AGENT_DEVICE_EXEC_TRACE = '1';
331 try {
332 return await fn();
333 } finally {
334 restoreOptionalEnv('AGENT_DEVICE_EXEC_TRACE', previousTraceEnv);
335 }
336}
337
338function restoreOptionalEnv(key: string, value: string | undefined): void {
339 if (value === undefined) {

Callers 1

exec.test.tsFile · 0.85

Calls 1

restoreOptionalEnvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…