MCPcopy
hub / github.com/spf13/cobra / runShellCheck

Function runShellCheck

bash_completions_test.go:56–75  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

54}
55
56func runShellCheck(s string) error {
57 cmd := exec.Command("shellcheck", "-s", "bash", "-", "-e",
58 "SC2034", // PREFIX appears unused. Verify it or export it.
59 )
60 cmd.Stderr = os.Stderr
61 cmd.Stdout = os.Stdout
62
63 stdin, err := cmd.StdinPipe()
64 if err != nil {
65 return err
66 }
67 go func() {
68 _, err := stdin.Write([]byte(s))
69 CheckErr(err)
70
71 stdin.Close()
72 }()
73
74 return cmd.Run()
75}
76
77// World worst custom function, just keep telling you to enter hello!
78const bashCompletionFunc = `__root_custom_func() {

Callers 1

TestBashCompletionsFunction · 0.85

Calls 1

CheckErrFunction · 0.85

Tested by

no test coverage detected