summaryrefslogtreecommitdiff
path: root/human.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-12 15:10:50 -0600
committerJeff Carr <[email protected]>2025-02-12 15:10:50 -0600
commit06564368bc07e90e721c26cb074d45e3a8ab3d6b (patch)
treed2a3a7699d3bd3915a3f43ceb8af2d95ac56eddf /human.go
parent815d061d5dab25614afa9ebe319456e3d4c1d16b (diff)
first attempt to install protoc on linuxv0.0.8v0.0.7v0.0.6
Diffstat (limited to 'human.go')
-rw-r--r--human.go36
1 files changed, 32 insertions, 4 deletions
diff --git a/human.go b/human.go
index 61da744..73c7089 100644
--- a/human.go
+++ b/human.go
@@ -4,19 +4,44 @@ import (
"fmt"
"os"
"os/exec"
+ "runtime"
"go.wit.com/log"
)
func CheckProtoc() bool {
- if checkCmdSimple("protoc") {
+ if !checkCmdSimple("protoc") {
userInstructions()
- log.Sleep(2)
+ switch runtime.GOOS {
+ case "linux":
+ linuxInstall("protoc")
+ case "macos":
+ log.Info("todo: print instructions here for installing protoc on macos. brew install?")
+ case "windows":
+ log.Info("todo: print instructions here for installing protoc on windows")
+ default:
+ log.Info("todo: print instructions here for installing protoc on", runtime.GOOS)
+ }
+ return false
+ }
+ if !checkCmdSimple("protoc") {
return false
}
- if checkCmdSimple("protoc-gen-go") {
+
+ if !checkCmdSimple("protoc-gen-go") {
userInstructions()
- log.Sleep(2)
+ switch runtime.GOOS {
+ case "linux":
+ linuxInstall("protoc-gen-go")
+ case "macos":
+ log.Info("todo: print instructions here for installing protoc on macos. brew install?")
+ case "windows":
+ log.Info("todo: print instructions here for installing protoc on windows")
+ default:
+ log.Info("todo: print instructions here for installing protoc on", runtime.GOOS)
+ }
+ }
+ if !checkCmdSimple("protoc-gen-go") {
return false
}
return true
@@ -43,6 +68,8 @@ func checkCmd(cmd string) (string, error) {
return path, err
}
+/*
+
func oldcheckCmd(cmd string) {
// path, err := exec.LookPath(cmd)
_, err := exec.LookPath(cmd)
@@ -54,6 +81,7 @@ func oldcheckCmd(cmd string) {
// fmt.Printf("%s is available at %s\n", cmd, path)
}
}
+*/
// todo: figure out how to determine, in a package, what the program name is
func okExit(s string) {