github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/old/integration/wshd/fake_hook/main.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  	"os/exec"
     7  	"path"
     8  
     9  	"github.com/onsi/gomega/gbytes"
    10  )
    11  
    12  func main() {
    13  	os.Chdir(path.Dir(os.Args[0]))
    14  	cmd := exec.Command(fmt.Sprintf("./hook-%s.sh", os.Args[1]))
    15  	cmd.Stdin = gbytes.NewBuffer() // avoid errors due to /dev/null not existing in fake container
    16  	cmd.Stdout = gbytes.NewBuffer()
    17  	cmd.Stderr = gbytes.NewBuffer()
    18  	if err := cmd.Run(); err != nil {
    19  		panic(err)
    20  	}
    21  }