[mac] better output text on build

This commit is contained in:
Lea Anthony
2021-11-02 22:20:44 +11:00
parent 1d1238cea3
commit 333949ee53
2 changed files with 21 additions and 8 deletions

View File

@@ -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 := ""

View File

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