From 77c1b9258f5de5ec0e8a5d3b69c1f3cf7143c154 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 15 Jan 2024 12:43:08 -0600 Subject: attempt to rebuild autotypist Signed-off-by: Jeff Carr --- unix.go | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'unix.go') diff --git a/unix.go b/unix.go index adb0b95..d167636 100644 --- a/unix.go +++ b/unix.go @@ -4,11 +4,39 @@ import ( "strings" "go.wit.com/log" - "go.wit.com/gui/gadgets/repostatus" + "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, " ") -- cgit v1.2.3