Only run compiled binary if same platform (fixes #20)

This commit is contained in:
Matthew Holt 2020-05-26 16:42:56 -06:00
parent 23d4e0a1ca
commit 823a072ae1
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -123,6 +123,7 @@ func runBuild(ctx context.Context, args []string) error {
} }
// prove the build is working by printing the version // prove the build is working by printing the version
if runtime.GOOS == os.Getenv("GOOS") && runtime.GOARCH == os.Getenv("GOARCH") {
if !filepath.IsAbs(output) { if !filepath.IsAbs(output) {
output = "." + string(filepath.Separator) + output output = "." + string(filepath.Separator) + output
} }
@ -135,6 +136,7 @@ func runBuild(ctx context.Context, args []string) error {
if err != nil { if err != nil {
log.Fatalf("[FATAL] %v", err) log.Fatalf("[FATAL] %v", err)
} }
}
return nil return nil
} }