Пример #1
0
//run it
func (d *Dogo) Run() {
	args := console.ParseText(d.RunCmd)
	d.cmd = exec.Command(args[0], args[1:]...)
	d.cmd.Stdin = os.Stdin
	d.cmd.Stdout = os.Stdout
	d.cmd.Stderr = os.Stderr
	err := d.cmd.Run()
	if err != nil {
		fmt.Printf("%s\n", err)
	} else {
		d.cmd = nil
	}
}
Пример #2
0
//build
func (d *Dogo) Build() error {
	fmt.Printf("[dogo] Start build: ")

	args := console.ParseText(d.BuildCmd)
	out, err := exec.Command(args[0], args[1:]...).CombinedOutput()
	if err != nil {
		fmt.Printf("\n%s", string(out))
		return err
	}

	fmt.Printf("success.\n")
	return nil
}
Пример #3
0
//build
func (d *Dogo) Build() error {
	d.FmtPrintf("[dogo] Start build: ")
	args := console.ParseText(d.BuildCmd)
	out, err := exec.Command(args[0], args[1:]...).CombinedOutput()
	if err != nil {
		fullOut := string(out)
		if d.buildErr == "" || d.buildErr != fullOut {
			d.FmtPrintf("\n%s", fullOut)
			d.retries = 0
			d.buildErr = fullOut
		} else {
			//d.FmtPrintf(".")
			d.retries++
		}
		return err
	} else {
		d.retries = 0
		d.buildErr = ""
		d.FmtPrintf("success.\n")
		return nil
	}
}