Skip to content

Commit

Permalink
- add -m(skip go mod tidy) build flag to dev command
Browse files Browse the repository at this point in the history
  • Loading branch information
te5se committed Feb 24, 2024
1 parent bff2258 commit 859476f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion v2/cmd/wails/flags/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type Build struct {
BuildCommon

NoPackage bool `name:"noPackage" description:"Skips platform specific packaging"`
SkipModTidy bool `name:"m" description:"Skip mod tidy before compile"`
Upx bool `description:"Compress final binary with UPX (if installed)"`
UpxFlags string `description:"Flags to pass to upx"`
Platform string `description:"Platform to target. Comma separate multiple platforms"`
Expand Down
1 change: 1 addition & 0 deletions v2/cmd/wails/flags/buildcommon.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type BuildCommon struct {
Verbosity int `name:"v" description:"Verbosity level (0 = quiet, 1 = normal, 2 = verbose)"`
Tags string `description:"Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated"`
NoSyncGoMod bool `description:"Don't sync go.mod"`
SkipModTidy bool `name:"m" description:"Skip mod tidy before compile"`
}

func (c BuildCommon) Default() BuildCommon {
Expand Down
10 changes: 6 additions & 4 deletions v2/cmd/wails/internal/dev/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
return err
}

// Run go mod tidy to ensure we're up-to-date
err = runCommand(cwd, false, f.Compiler, "mod", "tidy")
if err != nil {
return err
if !f.SkipModTidy {
// Run go mod tidy to ensure we're up-to-date
err = runCommand(cwd, false, f.Compiler, "mod", "tidy")
if err != nil {
return err
}
}

buildOptions := f.GenerateBuildOptions()
Expand Down

0 comments on commit 859476f

Please sign in to comment.