chore:test exit code.

This commit is contained in:
luoliwoshang
2025-05-22 09:24:15 +08:00
parent 254db35ef1
commit 780c927ea6

View File

@@ -512,8 +512,9 @@ func linkMainPkg(ctx *context, pkg *packages.Package, pkgs []*aPackage, conf *Co
cmd.Stderr = os.Stderr
cmd.Run()
if s := cmd.ProcessState; s != nil {
fmt.Fprintf(os.Stderr, "%s: exit code %d\n", app, s.ExitCode())
mockable.Exit(s.ExitCode())
exitCode := s.ExitCode()
fmt.Fprintf(os.Stderr, "%s: exit code %d\n", app, exitCode)
mockable.Exit(exitCode)
}
case ModeRun:
args := make([]string, 0, len(conf.RunArgs)+1)