コード例 #1
0
ファイル: ocitd.go プロジェクト: hqhq/oct
func RunCommand(cmd string) {
	os.Chdir(path.Join(pub_config.CacheDir, "source"))

	C.CSystem(C.CString(cmd))
	return
	fmt.Println("Run the command ", cmd)
	c := exec.Command("/bin/sh", "-c", cmd)
	c.Run()
	fmt.Println("After run the command ", cmd)
}
コード例 #2
0
ファイル: ocitd.go プロジェクト: hustcts/ocp-testing
func RunCommand(cmd string) {
	pre_uri := "/tmp/testcase_ocitd_cache/source"
	os.Chdir(pre_uri)

	C.CSystem(C.CString(cmd))
	return
	fmt.Println("Run the command ", cmd)
	c := exec.Command("/bin/sh", "-c", cmd)
	c.Run()
	fmt.Println("After run the command ", cmd)
}
コード例 #3
0
ファイル: ocitd.go プロジェクト: ChengTiesheng/oct-engine
func RunCommand(cmd string, dir string) {
	if pub_config.Debug {
		fmt.Println("Run the command < ", cmd, ">  in ", dir)
	}
	os.Chdir(dir)

	debugging := true
	if debugging {
		c := exec.Command("/bin/sh", "-c", cmd)
		c.Run()
	} else {
		C.CSystem(C.CString(cmd))
	}
	return

	// Golang bug? cannot get the standard output
	//	fmt.Println("Run the command ", cmd)
	//	c := exec.Command("/bin/sh", "-c", cmd)
	//	c.Run()
	//	fmt.Println("After run the command ", cmd)
}