package main import ( "strings" "go.wit.com/log" "go.wit.com/gui/tools/repostatus" ) var repopath string = "/home/jcarr/" func dryRunCommands() bool { var workingPath string = "go/src" for _, line := range script { if len(line) == 0 { continue } if line[0] == "cd" { switch len(line) { case 1: log.Verbose("do cmdPwd() to go root", repopath + "go/src") workingPath = "" case 2: log.Verbose("do cmdPwd() here", line) workingPath = line[1] default: log.Warn("bad cd", line) return false } continue } cmd := line[0] s := strings.Join(line[1:], " ") path := repopath + workingPath log.Warn("NEED TO RUN path =", path, "cmd =", cmd, "argv:", s) } return true } func runCommands() bool { for _, line := range script { s := strings.Join(line, " ") log.Warn("NEED TO RUN:", s) err, b, output := repostatus.RunCmd(repopath, line) if err != nil { log.Warn("ABEND EXECUTION") log.Warn("error =", err) log.Warn("output =", output) return false } log.Warn("Returned with b =", b) log.Warn("output was =", output) log.Warn("RUN DONE") } return true } func setGitCommands() { var tmp []string // convert to displayable to the user text for _, line := range script { s := strings.Join(line, " ") log.Warn("s =", s) tmp = append(tmp, s) } cmds.Set(strings.Join(tmp, "\n")) }