summaryrefslogtreecommitdiff
path: root/unix.go
blob: adb0b95691ddbe4221df4c7eee1f7e1d97e1957e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main

import (
	"strings"
	"go.wit.com/log"

	"go.wit.com/gui/gadgets/repostatus"
)

var repopath string = "/home/jcarr/"

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"))
}