5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 00:09:56 +08:00

Initial commit (#1352)

This commit is contained in:
Lea Anthony 2022-04-27 19:10:20 +10:00 committed by GitHub
parent 781a0df72e
commit e7aa74905a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View File

@ -96,6 +96,9 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
nsis := false
command.BoolFlag("nsis", "Generate NSIS installer for Windows", &nsis)
trimpath := false
command.BoolFlag("trimpath", "Remove all file system paths from the resulting executable", &trimpath)
command.Action(func() error {
quiet := verbosity == 0
@ -176,6 +179,7 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
CompressFlags: compressFlags,
UserTags: userTags,
WebView2Strategy: wv2rtstrategy,
TrimPath: trimpath,
}
// Start a new tabwriter

View File

@ -178,6 +178,10 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
commands.Add("-a")
}
if options.TrimPath {
commands.Add("-trimpath")
}
var tags slicer.StringSlicer
tags.Add(options.OutputType)
tags.AddSlice(options.UserTags)

View File

@ -55,6 +55,7 @@ type Options struct {
WailsJSDir string // Directory to generate the wailsjs module
ForceBuild bool // Force
BundleName string // Bundlename for Mac
TrimPath bool // Use Go's trimpath compiler flag
}
// Build the project!

View File

@ -69,6 +69,7 @@ A list of community maintained templates can be found [here](../community/templa
| -webview2 | WebView2 installer strategy: download,embed,browser,error | download |
| -u | Updates your project's `go.mod` to use the same version of Wails as the CLI | |
| -debug | Retains debug information in the application | false |
| -trimpath | Remove all file system paths from the resulting executable. | false |
For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide.