MCPcopy Create free account
hub / github.com/commander-cli/commander / createEnvVarsOption

Function createEnvVarsOption

pkg/runtime/local_executor.go:71–86  ·  view source on GitHub ↗
(test TestCase)

Source from the content-addressed store, hash-verified

69}
70
71func createEnvVarsOption(test TestCase) func(c *cmd.Command) {
72 return func(c *cmd.Command) {
73 // Add all env variables from parent process
74 if test.Command.InheritEnv {
75 for _, v := range os.Environ() {
76 split := strings.Split(v, "=")
77 c.AddEnv(split[0], split[1])
78 }
79 }
80
81 // Add custom env variables
82 for k, v := range test.Command.Env {
83 c.AddEnv(k, v)
84 }
85 }
86}
87
88func createTimeoutOption(timeout string) (func(c *cmd.Command), error) {
89 timeoutOpt := cmd.WithoutTimeout

Callers 1

ExecuteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected