MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / formatCmd

Function formatCmd

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

runPatch runs package manager update and upgrade (patch_all) or install (patch_package). Supports apt-get (Debian/Ubuntu), dnf, yum (RHEL-based), pkg (FreeBSD), pacman (Arch), and windows (WinGet for applications + WUA COM API for OS updates). formatCmd returns a shell-style "$ command args..." line

(name string, args ...string)

Source from the content-addressed store, hash-verified

2046// and windows (WinGet for applications + WUA COM API for OS updates).
2047// formatCmd returns a shell-style "$ command args..." line for display in output.
2048func formatCmd(name string, args ...string) string {
2049 parts := append([]string{name}, args...)
2050 return "$ " + strings.Join(parts, " ") + "\n"
2051}
2052
2053// streamSink accumulates stdout+stderr bytes from streaming patch-run commands,
2054// appends them to a fullOutput builder, and periodically POSTs stage="progress"

Callers 1

runPatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected