( override: CommandExecutorOverride | undefined, fn: () => Promise<T>, )
| 77 | const commandExecutorOverrideScope = new AsyncLocalStorage<CommandExecutorOverride | undefined>(); |
| 78 | |
| 79 | export 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. |
| 88 | export async function withoutCommandExecutorOverride<T>(fn: () => Promise<T>): Promise<T> { |
no outgoing calls