MCPcopy Create free account
hub / github.com/ellotheth/pipethis / Inspect

Method Inspect

script.go:189–207  ·  view source on GitHub ↗

Inspect checks whether an inspection was requested, and sends Script.Name() to editor if so. When editor exits, Inspect prompts the user to continue processing, and returns true to continue or false to stop.

(inspect bool, editor string)

Source from the content-addressed store, hash-verified

187// to editor if so. When editor exits, Inspect prompts the user to continue
188// processing, and returns true to continue or false to stop.
189func (s Script) Inspect(inspect bool, editor string) bool {
190 if !inspect || s.IsPiped() {
191 return true
192 }
193
194 log.Println("Opening", s.Name(), "in", editor)
195
196 cmd := exec.Command(editor, s.Name())
197 cmd.Stdout = os.Stdout
198 cmd.Stderr = os.Stderr
199 cmd.Stdin = os.Stdin
200 cmd.Run()
201
202 runScript := "y"
203 fmt.Print("Continue processing ", s.Name(), "? (Y/n) ")
204 fmt.Scanf("%s", &runScript)
205
206 return strings.ToLower(runScript) == "y"
207}
208
209// IsClearsigned returns true if the script and signature are attached,
210// and false otherwise.

Callers 1

mainFunction · 0.95

Calls 3

IsPipedMethod · 0.95
NameMethod · 0.95
RunMethod · 0.80

Tested by

no test coverage detected