drupflare/drangler - v0.1.0
    Preparing search index...

    Interface ScriptedRunner

    The one seam every subprocess in drangler goes through.

    git, ssh and wrangler are all reached this way, so a spec injects one fake and covers all three without a process, a network or a login.

    interface ScriptedRunner {
        calls: RecordedCall[];
        run(
            file: string,
            args: readonly string[],
            opts?: RunOptions,
        ): Promise<CommandResult>;
        spawn(
            file: string,
            args: readonly string[],
            opts?: RunOptions,
        ): Promise<number>;
    }

    Hierarchy (View Summary)

    Index
    calls: RecordedCall[]
    • Hands the terminal over to a subprocess and waits for its exit code.

      The split from run is about what the OUTPUT is for. run captures because the caller parses it -- git status --porcelain, wrangler's gzip line. spawn inherits because the caller wants the user to watch it: wrangler dev never exits on its own and bun run hydrate downloads 15 MB, so both would sit silent behind a buffer and a timeout.

      Parameters

      • file: string
      • args: readonly string[]
      • Optionalopts: RunOptions

      Returns Promise<number>