diff --git a/v2/cmd/wails/flags/build.go b/v2/cmd/wails/flags/build.go index 618a2d4e8..d36ceef6a 100644 --- a/v2/cmd/wails/flags/build.go +++ b/v2/cmd/wails/flags/build.go @@ -2,14 +2,15 @@ package flags import ( "fmt" - "github.com/leaanthony/slicer" - "github.com/wailsapp/wails/v2/internal/system" - "github.com/wailsapp/wails/v2/pkg/commands/build" - "github.com/wailsapp/wails/v2/pkg/commands/buildtags" "os" "os/exec" "runtime" "strings" + + "github.com/leaanthony/slicer" + "github.com/wailsapp/wails/v2/internal/system" + "github.com/wailsapp/wails/v2/pkg/commands/build" + "github.com/wailsapp/wails/v2/pkg/commands/buildtags" ) const ( @@ -51,7 +52,6 @@ type Build struct { } func (b *Build) Default() *Build { - defaultPlatform := os.Getenv("GOOS") if defaultPlatform == "" { defaultPlatform = runtime.GOOS @@ -64,13 +64,13 @@ func (b *Build) Default() *Build { defaultArch = runtime.GOARCH } } - b.defaultArch = defaultArch - platform := defaultPlatform + "/" + defaultArch result := &Build{ - Platform: platform, + Platform: defaultPlatform + "/" + defaultArch, WebView2: "download", GarbleArgs: "-literals -tiny -seed=random", + + defaultArch: defaultArch, } result.BuildCommon = result.BuildCommon.Default() return result diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 4e75d066f..ada7df8d9 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed set window background colour on Windows when setting the colour via runtime. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279) - Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299) - Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302) +- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309) ## v2.3.0 - 2022-12-29