File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,19 @@ import (
1111 "time"
1212)
1313
14+ type CommandInterface interface {
15+ AddEnv (string , string )
16+ Stdout () string
17+ Stderr () string
18+ Combined () string
19+ ExitCode () int
20+ Executed () bool
21+ ExecuteContext (context.Context ) error
22+ Execute () error
23+ }
24+
25+ var _ CommandInterface = (* Command )(nil )
26+
1427// Command represents a single command which can be executed
1528type Command struct {
1629 Command string
@@ -165,7 +178,7 @@ func WithEnvironmentVariables(env EnvVars) func(c *Command) {
165178
166179// AddEnv adds an environment variable to the command
167180// If a variable gets passed like ${VAR_NAME} the env variable will be read out by the current shell
168- func (c * Command ) AddEnv (key string , value string ) {
181+ func (c * Command ) AddEnv (key , value string ) {
169182 value = os .ExpandEnv (value )
170183 c .Env = append (c .Env , fmt .Sprintf ("%s=%s" , key , value ))
171184}
You can’t perform that action at this time.
0 commit comments