summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-31 17:19:53 -0500
committerJeff Carr <[email protected]>2025-08-31 17:19:53 -0500
commitcc5db9ba7ea3d4b636ea2870fe0a3f3decaa9177 (patch)
treec38629d8b3ade311e857dbb1a8b71a5d3f399e74
parentc847491037a9bdb4d315f8ef5a187dfcdcca1d51 (diff)
attempt to fix macos buildv0.0.14
-rw-r--r--human.go4
-rw-r--r--install.go7
-rw-r--r--install_darwin.go12
-rw-r--r--install_linux.go (renamed from linux.go)4
-rw-r--r--install_windows.go12
5 files changed, 36 insertions, 3 deletions
diff --git a/human.go b/human.go
index fa7fb8c..d202673 100644
--- a/human.go
+++ b/human.go
@@ -14,7 +14,7 @@ func CheckProtoc() bool {
userInstructions()
switch runtime.GOOS {
case "linux":
- linuxInstall("protoc")
+ Install("protoc")
case "macos":
log.Info("todo: print instructions here for installing protoc on macos. brew install?")
case "windows":
@@ -32,7 +32,7 @@ func CheckProtoc() bool {
userInstructions()
switch runtime.GOOS {
case "linux":
- linuxInstall("protoc-gen-go")
+ Install("protoc-gen-go")
case "macos":
log.Info("todo: print instructions here for installing protoc on macos. brew install?")
case "windows":
diff --git a/install.go b/install.go
new file mode 100644
index 0000000..f9199dc
--- /dev/null
+++ b/install.go
@@ -0,0 +1,7 @@
+package fhelp
+
+// auto run protoc with the correct args
+
+func Install(pkg string) error {
+ return osInstall(pkg)
+}
diff --git a/install_darwin.go b/install_darwin.go
new file mode 100644
index 0000000..ac97d4d
--- /dev/null
+++ b/install_darwin.go
@@ -0,0 +1,12 @@
+package fhelp
+
+// auto run protoc with the correct args
+
+import (
+ "go.wit.com/log"
+)
+
+func osInstall(pkg string) error {
+ log.Info("todo: add instructions on macos to install", pkg)
+ return log.Errorf("user didn't install package %s", pkg)
+}
diff --git a/linux.go b/install_linux.go
index efdb6e8..0ed600b 100644
--- a/linux.go
+++ b/install_linux.go
@@ -12,7 +12,7 @@ import (
"go.wit.com/log"
)
-func linuxInstall(pkg string) {
+func osInstall(pkg string) error {
cmd := []string{"apt", "install", "-y", pkg}
if pkg == "protoc" {
cmd = []string{"apt", "install", "-y", "protobuf-compiler"}
@@ -28,7 +28,9 @@ func linuxInstall(pkg string) {
switch line {
case "y":
shell.Sudo(cmd)
+ return nil
default:
}
}
+ return log.Errorf("user didn't install package %s", pkg)
}
diff --git a/install_windows.go b/install_windows.go
new file mode 100644
index 0000000..3e99f01
--- /dev/null
+++ b/install_windows.go
@@ -0,0 +1,12 @@
+package fhelp
+
+// auto run protoc with the correct args
+
+import (
+ "go.wit.com/log"
+)
+
+func osInstall(pkg string) error {
+ log.Info("todo: add instructions on windows to install", pkg)
+ return log.Errorf("user didn't install package %s", pkg)
+}