Skip to main content

run_gh

Function run_gh 

Source
pub fn run_gh<I, S>(
    bin: &Path,
    args: I,
    label: &str,
    cwd: Option<&Path>,
) -> Result<Output>
where I: IntoIterator<Item = S>, S: AsRef<str>,
Expand description

Runs one gh invocation through the choke point, recording a kind: "gh" request-log line for it.

label is the semantic subcommand ("api graphql", "pr list", "--version"); it is split into the record’s command for per-subcommand aggregation and category derivation. cwd, when given, sets the child’s working directory (several call sites run gh inside a repo).

Blocking (Command::output) — daemon callers must already be on a blocking thread. The Output (or spawn io::Error) is returned verbatim, so this is a drop-in for an existing Command::new("gh").…​.output(); logging is best-effort and never alters the result. Source is read from the ambient request_log::current_context, so no call site threads it.