40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package fhelp
|
|
|
|
import (
|
|
"go.wit.com/lib/gui/shell"
|
|
"go.wit.com/log"
|
|
)
|
|
|
|
func BuildPlugin(pname string) bool {
|
|
if CheckProtoc() {
|
|
log.Info("You have the right tools for protobufs")
|
|
} else {
|
|
log.Info("You do not have the right tools for protobufs")
|
|
}
|
|
|
|
log.Info("")
|
|
log.Info("### Error ####")
|
|
log.Info("The GUI golang plugins did not load for the", pname)
|
|
log.Info("You will have to rebuild them")
|
|
log.Info("go-clone go.wit.com/toolkits/<pick one>/")
|
|
log.Info("TODO: try to rebuild them here")
|
|
log.Info("TODO: falling back to STDIN interface")
|
|
log.Info("### Error ####")
|
|
log.Info("")
|
|
log.Infof("To attempt to build the %s plugin, run:\n", pname)
|
|
log.Info("forge --build go.wit.com/toolkits/gocui")
|
|
log.Info("")
|
|
if !QuestionUser("Would you like to run that now?") {
|
|
return false
|
|
}
|
|
r := shell.RunRealtime([]string{"forge", "--build", "go.wit.com/toolkits/" + pname})
|
|
if r.Error == nil {
|
|
log.Info("build worked")
|
|
log.Info("You must copy that file to ~/go/lib/go-gui/")
|
|
return true
|
|
} else {
|
|
log.Info("build failed")
|
|
}
|
|
return false
|
|
}
|