MCPcopy
hub / github.com/cloudfoundry/cli / CFWithStdin

Function CFWithStdin

integration/helpers/command.go:84–94  ·  view source on GitHub ↗

CFWithStdin runs a 'cf' command with a custom stdin and given arguments.

(stdin io.Reader, args ...string)

Source from the content-addressed store, hash-verified

82
83// CFWithStdin runs a 'cf' command with a custom stdin and given arguments.
84func CFWithStdin(stdin io.Reader, args ...string) *Session {
85 WriteCommand("", nil, args)
86 command := exec.Command("cf", args...)
87 command.Stdin = stdin
88 session, err := Start(
89 command,
90 NewPrefixedWriter(DebugOutPrefix, GinkgoWriter),
91 NewPrefixedWriter(DebugErrPrefix, GinkgoWriter))
92 Expect(err).NotTo(HaveOccurred())
93 return session
94}
95
96// CFWithEnv runs a 'cf' command with specified environment variables and given arguments.
97func CFWithEnv(envVars map[string]string, args ...string) *Session {

Calls 3

WriteCommandFunction · 0.85
CommandMethod · 0.65
StartFunction · 0.50

Tested by

no test coverage detected