summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-15 13:53:44 -0600
committerJeff Carr <[email protected]>2024-01-15 13:53:44 -0600
commit8ddc35e1985cdb2411eb25faead86d631421a6ab (patch)
tree3181966f487e021db81e9f151610f32692ff83e6 /unix.go
parent77c1b9258f5de5ec0e8a5d3b69c1f3cf7143c154 (diff)
closer to automatic 'go get' myself
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/unix.go b/unix.go
index d167636..156e764 100644
--- a/unix.go
+++ b/unix.go
@@ -9,7 +9,9 @@ import (
var repopath string = "/home/jcarr/"
-func dryRunCommands() bool {
+// if dryRun == true, then it just prints out the values
+// but doesn't do anything
+func goMake(dryRun string) bool {
var workingPath string = "go/src"
for _, line := range script {
if len(line) == 0 {
@@ -33,6 +35,24 @@ func dryRunCommands() bool {
s := strings.Join(line[1:], " ")
path := repopath + workingPath
log.Warn("NEED TO RUN path =", path, "cmd =", cmd, "argv:", s)
+ if dryRun == "--dry-run" {
+ continue
+ }
+ if dryRun == "--doit" {
+ log.Warn("Actually RUN path =", path, "cmd =", cmd, "argv:", s)
+ err, b, output := repostatus.RunCmd(repopath, line)
+ if err != nil {
+ log.Info("ABEND EXECUTION")
+ log.Info("error =", err)
+ log.Info("b =", b)
+ log.Info("output =", output)
+ return false
+ }
+ log.Warn("output was =", output)
+ continue
+ }
+ log.Warn("don't know what to do. dryRun ==", dryRun)
+ return false
}
return true
}