runner

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package runner executes VCS or shell commands across multiple repos in parallel, streaming results back through a channel as each completes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	backendName string,
	args []string,
	concurrency int,
) (<-chan Result, error)

Dispatch runs args via backendName across the given repos, streaming one Result per repo to the returned channel. The channel is closed when all goroutines finish. The caller should drain the channel before inspecting the returned error (which reflects infrastructure failures only).

func GatherStatus

func GatherStatus(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	concurrency int,
) <-chan StatusResult

GatherStatus streams one StatusResult per repo to the returned channel.

func ResultColor added in v0.3.0

func ResultColor(res Result) string

ResultColor returns the display color ("red" or "green") for a result based on whether it errored or had a non-zero exit code.

func Shell

func Shell(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	shellCmd string,
	concurrency int,
) <-chan Result

Shell runs across repos using sh -c directly (no backend routing).

func ShellCommand added in v0.12.0

func ShellCommand() (string, string)

ShellCommand returns the system shell binary and its command flag: `/bin/sh -c` on POSIX, `%COMSPEC% /c` on Windows.

func VCSSubcmd added in v0.3.0

func VCSSubcmd(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	op string,
	extraArgs []string,
	concurrency int,
) <-chan Result

VCSSubcmd runs a VCS subcommand (status, diff, log, fetch, push, pull, etc.) across repos, resolving backend-specific arg prefixes automatically. For example, "fetch" becomes ["fetch"] for git but ["git", "fetch"] for jj. extraArgs (may be nil) are appended after the resolved subcommand args.

Types

type Result

type Result struct {
	RepoName string
	RepoPath string
	VCS      string
	Output   string
	ExitCode int
	Err      error
}

Result for a single repo, sent through the results channel.

type StatusResult

type StatusResult struct {
	RepoName string
	RepoPath string
	VCS      string
	Status   backend.RepoStatus
	Err      error
}

StatusResult is the live status used by `ll`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL