From 61b9e50b8e19f5e4d58d79ea75badb909902a67d Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 21 Apr 2020 06:00:36 +1000 Subject: [PATCH] Rapply -o suffix handling --- cmd/helpers.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/helpers.go b/cmd/helpers.go index 3645d1b10..1a8d56144 100644 --- a/cmd/helpers.go +++ b/cmd/helpers.go @@ -9,6 +9,7 @@ import ( "path/filepath" "runtime" "strconv" + "strings" "time" "github.com/leaanthony/mewn" @@ -221,6 +222,17 @@ func BuildNative(binaryName string, forceRebuild bool, buildMode string, project } if binaryName != "" { + // Alter binary name based on OS + switch projectOptions.Platform { + case "windows": + if !strings.HasSuffix(binaryName, ".exe") { + binaryName += ".exe" + } + default: + if strings.HasSuffix(binaryName, ".exe") { + binaryName = strings.TrimSuffix(binaryName, ".exe") + } + } buildCommand.Add("-o", filepath.Join("build", binaryName)) }