chore: add new interactive release package (#22624)

This commit is contained in:
Garrett Delfosse
2026-03-18 12:19:54 -04:00
committed by GitHub
parent a130a7dc97
commit 1f5f6c9ccb
11 changed files with 1879 additions and 443 deletions
+30
View File
@@ -0,0 +1,30 @@
package main
import (
"errors"
"os/exec"
"strings"
)
// gitOutput runs a read-only git command and returns trimmed stdout.
func gitOutput(args ...string) (string, error) {
cmd := exec.Command("git", args...)
out, err := cmd.Output()
if err != nil {
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
return "", exitErr
}
return "", err
}
return strings.TrimSpace(string(out)), nil
}
// gitRun runs a git command with stdout/stderr connected to the
// terminal.
func gitRun(args ...string) error {
cmd := exec.Command("git", args...)
cmd.Stdout = nil
cmd.Stderr = nil
return cmd.Run()
}