mage: show variables

This commit is contained in:
Cadey Ratio 2018-01-20 08:58:49 -08:00
parent eb5d770c45
commit d41ed43455
1 changed files with 12 additions and 0 deletions

12
mage.go
View File

@ -32,6 +32,10 @@ func buildBins(goos, goarch string) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
fmt.Print("generating code...")
Generate(ctx)
fmt.Print("\rCode generation successful \n")
d := filepath.Join(wd, "./bin") d := filepath.Join(wd, "./bin")
os.MkdirAll(filepath.Join(d, goos, goarch), 0777) os.MkdirAll(filepath.Join(d, goos, goarch), 0777)
@ -181,3 +185,11 @@ func Generate(ctx context.Context) {
shouldWork(ctx, nil, dir, "sh", "./regen.sh") shouldWork(ctx, nil, dir, "sh", "./regen.sh")
} }
// Vars shows the various variables that this magefile uses.
func Vars() {
qod.Printlnf("goarch:\t%s", runtime.GOARCH)
qod.Printlnf("goos:\t%s", runtime.GOOS)
qod.Printlnf("arches:\t%v", arches)
qod.Printlnf("wd:\t%s", wd)
}