Exemple #1
0
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)
}
Exemple #2
0
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)
}
Exemple #3
0
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)
}