fix: 隐藏 Windows 上 git 子进程的控制台窗口

This commit is contained in:
zyj
2026-03-10 09:26:18 +08:00
parent a50af3f07a
commit 423a6a8b42
3 changed files with 23 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ func (g *GitClient) Run(path string, args ...string) (string, error) {
argsArr := append(header, args...)
log.Println(argsArr)
cmd := exec.CommandContext(ctx, "git", argsArr...)
hideWindow(cmd)
var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr