buildx-manager/buildx/command.go
2024-10-05 01:43:59 +02:00

27 lines
414 B
Go

package buildx
import (
"os"
"os/exec"
"git.tek.govt.hu/dowerx/buildx-manager/config"
)
type Command struct {
Program string
Arguments []string
WorkingDirectory string
}
func (c *Command) Run() error {
cmd := exec.Command(c.Program, c.Arguments...)
cmd.Dir = c.WorkingDirectory
if config.GetConfig().Verbose {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
}
return cmd.Run()
}