From 333949ee53ef037d35b29ff4abee7e39c88a453c Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 2 Nov 2021 22:20:44 +1100 Subject: [PATCH] [mac] better output text on build --- v2/cmd/wails/internal/commands/build/build.go | 14 +++++++------- v2/pkg/commands/build/build.go | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/v2/cmd/wails/internal/commands/build/build.go b/v2/cmd/wails/internal/commands/build/build.go index cba548e2..7beb644a 100644 --- a/v2/cmd/wails/internal/commands/build/build.go +++ b/v2/cmd/wails/internal/commands/build/build.go @@ -117,21 +117,21 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { } // Tags - //experimental := false + experimental := false userTags := []string{} for _, tag := range strings.Split(tags, " ") { thisTag := strings.TrimSpace(tag) if thisTag != "" { userTags = append(userTags, thisTag) } - //if thisTag == "exp" { - // experimental = true - //} + if thisTag == "exp" { + experimental = true + } } - //if runtime.GOOS == "darwin" && !experimental { - // return fmt.Errorf("MacOS version coming soon!") - //} + if runtime.GOOS == "linux" && !experimental { + return fmt.Errorf("Linux version coming soon!") + } // Webview2 installer strategy (download by default) wv2rtstrategy := "" diff --git a/v2/pkg/commands/build/build.go b/v2/pkg/commands/build/build.go index a64858ae..9af037bc 100644 --- a/v2/pkg/commands/build/build.go +++ b/v2/pkg/commands/build/build.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" "runtime" + "strings" "github.com/wailsapp/wails/v2/internal/fs" @@ -209,6 +210,18 @@ func Build(options *Options) (string, error) { return "", err } - return options.CompiledBinary, nil + result := options.CompiledBinary + + if options.Pack && options.Platform == "darwin" { + sr := strings.Split(result, "/") + for i := len(sr) - 1; i >= 0; i-- { + if strings.Contains(sr[i], ".app") { + result = strings.Join(sr[:i+1], "/") + break + } + } + } + + return result, nil }