github.com/pluralsh/plural-cli@v0.9.5/pkg/pluralfile/command.go (about) 1 package pluralfile 2 3 import ( 4 "fmt" 5 "os" 6 "os/exec" 7 "strings" 8 ) 9 10 type Command struct { 11 Command string 12 Args []string 13 } 14 15 func (c *Command) Type() ComponentName { 16 return COMMAND 17 } 18 19 func (c *Command) Key() string { 20 return "" 21 } 22 23 func (c *Command) Push(repo string, sha string) (string, error) { 24 fmt.Println("") 25 cmd := exec.Command("/bin/sh", "-c", fmt.Sprintf("%s %s", c.Command, strings.Join(c.Args, " "))) 26 cmd.Stdout = os.Stdout 27 cmd.Stderr = os.Stderr 28 return "", cmd.Run() 29 }