Skip to content

Commit

Permalink
- add -m(skip go mod tidy) build flag to dev command (#3275)
Browse files Browse the repository at this point in the history
* - add -m(skip go mod tidy) build flag to dev command

* - add changelog entry for PR #3275
  • Loading branch information
te5se authored Feb 26, 2024
1 parent bff2258 commit 65cef2f
Show file tree
Hide file tree
Showing 4 changed files with 8 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
1 change: 1 addition & 0 deletions website/src/pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
- Added docs to help fix NixOs/Wayland font-size css issue. Added by @atterpac in [PR](https://github.com/wailsapp/wails/pull/3268)
- Added -m (skip `go mod tidy`) flag to dev command by @te5se in [PR](https://github.com/wailsapp/wails/pull/3275)

## v2.8.0 - 2024-02-08

Expand Down

0 comments on commit 65cef2f

Please sign in to comment.