MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / patchRunTrailer

Function patchRunTrailer

agent-source-code/cmd/patchmon-agent/commands/serve.go:2182–2194  ·  view source on GitHub ↗

patchRunTrailer returns a short human-readable trailer the agent appends to the tail of a patch run's shell output so the live terminal view has a clear "this is the end" marker regardless of what the underlying package manager printed last. The same text is included in the authoritative fullOutput

(wasStopped bool, stepErr error, dryRun bool)

Source from the content-addressed store, hash-verified

2180// fullOutput sent with the terminal stage, so users see the trailer whether
2181// they're reading the live WebSocket buffer or the persisted shell_output.
2182func patchRunTrailer(wasStopped bool, stepErr error, dryRun bool) string {
2183 ts := time.Now().UTC().Format(time.RFC3339)
2184 switch {
2185 case wasStopped:
2186 return fmt.Sprintf("\n--- Patch run stopped by user at %s ---\n", ts)
2187 case stepErr != nil:
2188 return fmt.Sprintf("\n--- Patch run failed at %s ---\n", ts)
2189 case dryRun:
2190 return fmt.Sprintf("\n--- Dry run completed at %s ---\n", ts)
2191 default:
2192 return fmt.Sprintf("\n--- Patch run completed at %s ---\n", ts)
2193 }
2194}
2195
2196// When dryRun is true, simulates and sends dry_run_completed instead of completed.
2197func runPatch(patchRunID, patchType string, packageNames []string, dryRun bool) error {

Callers 2

runPatchFunction · 0.85
runPatchWindowsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected