github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/cmd/chore/e2e/run/orbctl.go (about) 1 package main 2 3 import ( 4 "context" 5 "os/exec" 6 7 "github.com/caos/orbos/cmd/chore" 8 ) 9 10 type newOrbctlCommandFunc func(context.Context) *exec.Cmd 11 12 func buildOrbctl(ctx context.Context, settings programSettings) (newOrbctlCommandFunc, error) { 13 newCmd, err := chore.Orbctl(false, false) 14 if err != nil { 15 return nil, err 16 } 17 18 if err := runCommand(settings, orbctl.strPtr(), nil, nil, newCmd(ctx), "--version"); err != nil { 19 return nil, err 20 } 21 22 return func(ctx context.Context) *exec.Cmd { 23 cmd := newCmd(ctx) 24 cmd.Args = append(cmd.Args, "--orbconfig", settings.orbconfig) 25 return cmd 26 }, nil 27 }