Track error count in issues.go alongside the existing issues slice. Add hasErrors() helper. In main.go, call osExit(1) after writeRunLog() if any [ERROR] entries were recorded, so CI steps correctly fail when errors occur (e.g. GitHub API 403 rate-limit hits in the macOS job). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
44 lines
739 B
Go
44 lines
739 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
func resetMocks() {
|
|
runCmd = runCmdReal
|
|
runShell = runShellReal
|
|
hasCmd = hasCmdReal
|
|
probe = probeReal
|
|
|
|
download = downloadReal
|
|
fetchJSON = fetchJSONReal
|
|
fetchText = fetchTextReal
|
|
|
|
osStat = os.Stat
|
|
osReadFile = os.ReadFile
|
|
osWriteFile = os.WriteFile
|
|
osMkdirAll = os.MkdirAll
|
|
osRemove = os.Remove
|
|
osRemoveAll = os.RemoveAll
|
|
osRename = os.Rename
|
|
osExit = os.Exit
|
|
stdin = os.Stdin
|
|
|
|
// Reset global state variables to safe defaults
|
|
isMacOS = false
|
|
pkgMgr = "dnf"
|
|
isRHELFamily = true
|
|
isArchFamily = false
|
|
osName = "linux"
|
|
archName = "x86_64"
|
|
|
|
osReleasePath = "/etc/os-release"
|
|
passwdPath = "/etc/passwd"
|
|
|
|
issuesMu.Lock()
|
|
issues = nil
|
|
notices = nil
|
|
errorCount = 0
|
|
issuesMu.Unlock()
|
|
}
|