5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 02:39:30 +08:00

Rapply -o suffix handling

This commit is contained in:
Lea Anthony 2020-04-21 06:00:36 +10:00
parent 47916216de
commit 61b9e50b8e

View File

@ -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))
}