attempt to fix macos build
This commit is contained in:
parent
c847491037
commit
cc5db9ba7e
4
human.go
4
human.go
|
@ -14,7 +14,7 @@ func CheckProtoc() bool {
|
||||||
userInstructions()
|
userInstructions()
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux":
|
case "linux":
|
||||||
linuxInstall("protoc")
|
Install("protoc")
|
||||||
case "macos":
|
case "macos":
|
||||||
log.Info("todo: print instructions here for installing protoc on macos. brew install?")
|
log.Info("todo: print instructions here for installing protoc on macos. brew install?")
|
||||||
case "windows":
|
case "windows":
|
||||||
|
@ -32,7 +32,7 @@ func CheckProtoc() bool {
|
||||||
userInstructions()
|
userInstructions()
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux":
|
case "linux":
|
||||||
linuxInstall("protoc-gen-go")
|
Install("protoc-gen-go")
|
||||||
case "macos":
|
case "macos":
|
||||||
log.Info("todo: print instructions here for installing protoc on macos. brew install?")
|
log.Info("todo: print instructions here for installing protoc on macos. brew install?")
|
||||||
case "windows":
|
case "windows":
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package fhelp
|
||||||
|
|
||||||
|
// auto run protoc with the correct args
|
||||||
|
|
||||||
|
func Install(pkg string) error {
|
||||||
|
return osInstall(pkg)
|
||||||
|
}
|
|
@ -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)
|
||||||
|
}
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func linuxInstall(pkg string) {
|
func osInstall(pkg string) error {
|
||||||
cmd := []string{"apt", "install", "-y", pkg}
|
cmd := []string{"apt", "install", "-y", pkg}
|
||||||
if pkg == "protoc" {
|
if pkg == "protoc" {
|
||||||
cmd = []string{"apt", "install", "-y", "protobuf-compiler"}
|
cmd = []string{"apt", "install", "-y", "protobuf-compiler"}
|
||||||
|
@ -28,7 +28,9 @@ func linuxInstall(pkg string) {
|
||||||
switch line {
|
switch line {
|
||||||
case "y":
|
case "y":
|
||||||
shell.Sudo(cmd)
|
shell.Sudo(cmd)
|
||||||
|
return nil
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return log.Errorf("user didn't install package %s", pkg)
|
||||||
}
|
}
|
|
@ -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)
|
||||||
|
}
|
Loading…
Reference in New Issue