//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 } }
//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 }
//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 } }