diff --git a/mage.go b/mage.go index d2c0160..5c0e41e 100644 --- a/mage.go +++ b/mage.go @@ -54,7 +54,7 @@ func goBuildPlugin(ctx context.Context, dir, pkgname, fname string) { return } - shouldWork(ctx, nil, dir, "go", "build", "-buildmode=plugin", "-o=fname", pkgBase+pkgname) + shouldWork(ctx, nil, dir, "go", "build", "-buildmode=plugin", "-o="+fname, pkgBase+pkgname) } func buildBins(goos string) { @@ -79,6 +79,7 @@ func buildBins(goos string) { // Linux builds binaries for linux func Linux() { buildBins("linux") + Plugin() } // Windows builds binaries for windows @@ -94,6 +95,10 @@ func Darwin() { // Build builds the binaries for route and routed. func Build() { buildBins(runtime.GOOS) + + if runtime.GOOS == "linux" { + Plugin() + } } // Plugin builds all of the plugins for programs wanting to augment themselves with route.