MCPcopy
hub / github.com/dagger/container-use / AddCommand

Method AddCommand

environment/note.go:21–34  ·  view source on GitHub ↗
(command string, exitCode int, stdout, stderr string)

Source from the content-addressed store, hash-verified

19}
20
21func (n *Notes) AddCommand(command string, exitCode int, stdout, stderr string) {
22 msg := fmt.Sprintf("$ %s", strings.TrimSpace(command))
23 if exitCode != 0 {
24 msg += fmt.Sprintf("\nexit %d", exitCode)
25 }
26 if strings.TrimSpace(stdout) != "" {
27 msg += fmt.Sprintf("\n%s", stdout)
28 }
29 if strings.TrimSpace(stderr) != "" {
30 msg += fmt.Sprintf("\nstderr: %s", stderr)
31 }
32
33 n.Add("%s", msg)
34}
35
36func (n *Notes) Clear() {
37 n.mu.Lock()

Callers 15

buildBaseMethod · 0.80
RunMethod · 0.80
RunBackgroundMethod · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80

Calls 1

AddMethod · 0.95

Tested by

no test coverage detected