MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / ReadValuesFromPipe

Function ReadValuesFromPipe

pkg/util/pipe.go:15–24  ·  view source on GitHub ↗

ReadValuesFromPipe will return an array of strings from the pipe input separated by new line.

()

Source from the content-addressed store, hash-verified

13// ReadValuesFromPipe will return an array of strings from the pipe
14// input separated by new line.
15func ReadValuesFromPipe() []string {
16 items := []string{}
17 if IsCalledFromPipe() {
18 scanner := bufio.NewScanner(bufio.NewReader(os.Stdin))
19 for scanner.Scan() {
20 items = append(items, scanner.Text())
21 }
22 }
23 return items
24}

Callers 1

NewCmdWaitFunction · 0.92

Calls 1

IsCalledFromPipeFunction · 0.85

Tested by

no test coverage detected