Skip to content

refactor: use sourcegraph/run for command execution#127

Merged
unknwon merged 14 commits intov2from
use-sourcegraph-run
Feb 15, 2026
Merged

refactor: use sourcegraph/run for command execution#127
unknwon merged 14 commits intov2from
use-sourcegraph-run

Conversation

@unknwon
Copy link
Member

@unknwon unknwon commented Feb 14, 2026

Summary

  • Replace custom os/exec-based command execution in command.go with github.com/sourcegraph/run, delegating process lifecycle management to the library
  • Preserve the entire public API surface (RunInDir, RunInDirPipeline, RunInDirWithOptions, Run) and all behavioral contracts (default timeout, cancellation → context.Canceled, deadline → ErrExecTimeout, stderr in errors, debug logging)
  • Use run.Arg() to properly quote arguments for the library's shell-based parser, and Output.Stream() for raw byte-preserving output (important for binary-ish output like ls-tree -z)

All existing tests pass without modification.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant