summaryrefslogtreecommitdiff
path: root/buildPlugin.go
blob: 6dbe187cebc99c99663283c2cbf5ee22054aa09d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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)
	cmd := []string{"forge", "dev", "--build", "go.wit.com/toolkits/" + pname}
	log.Info(cmd)
	log.Info("")
	if !QuestionUser("Would you like to run that now?") {
		return false
	}
	r := shell.RunRealtime(cmd)
	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
}