MCPcopy Index your code
hub / github.com/callstack/agent-device / withCommandExecutorOverride

Function withCommandExecutorOverride

src/utils/exec.ts:79–85  ·  view source on GitHub ↗
(
  override: CommandExecutorOverride | undefined,
  fn: () => Promise<T>,
)

Source from the content-addressed store, hash-verified

77const commandExecutorOverrideScope = new AsyncLocalStorage<CommandExecutorOverride | undefined>();
78
79export async function withCommandExecutorOverride<T>(
80 override: CommandExecutorOverride | undefined,
81 fn: () => Promise<T>,
82): Promise<T> {
83 if (!override) return await fn();
84 return await commandExecutorOverrideScope.run(override, fn);
85}
86
87// Used by local executors to bypass the active override for intentional host command execution.
88export async function withoutCommandExecutorOverride<T>(fn: () => Promise<T>): Promise<T> {

Calls

no outgoing calls

Tested by 2

withFakeAppleToolsFunction · 0.72
prepareXctestrunJsonFunction · 0.72