diff --git a/doRelease.go b/doRelease.go index 55ff7df..9cdd6d3 100644 --- a/doRelease.go +++ b/doRelease.go @@ -32,6 +32,8 @@ func doRelease() bool { } else { pwd, _ := os.Getwd() log.Info("go.mod disappeared. need to run go mod init and go mod tidy here:", pwd) + shell.RunRealtime([]string{"go", "mod", "init"}) + shell.RunRealtime([]string{"go", "mod", "tidy"}) return false } @@ -186,7 +188,14 @@ func doPublishVersion() bool { if gopath == "go.wit.com/apps/guireleaser" { log.Info("CAN NOT SELF UPDATE. cmd =", docmd) log.Info("go get must be run from somewhere else other than guireleaser") - result = shell.PathRun("/home/jcarr/go/src/go.wit.com/apps/autotypist", docmd) + log.Info("chdir to autotypist if it exists") + if shell.Exists("/home/jcarr/go/src/go.wit.com/apps/autotypist") { + os.Chdir("/home/jcarr/go/src/go.wit.com/apps/autotypist") + } else { + log.Info("need to chdir somewhere with go.sum & go.mod") + return false + } + // result = shell.PathRun("/home/jcarr/go/src/go.wit.com/apps/autotypist", docmd) } else { // publish go.mod & go.sum for use with go os.Unsetenv("GO111MODULE")