mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Run go mod tidy before compilation
This commit is contained in:
parent
bac3e9e5c1
commit
bb8e848ef6
1 changed files with 9 additions and 2 deletions
|
|
@ -145,6 +145,13 @@ func (b *BaseBuilder) CleanUp() {
|
|||
// CompileProject compiles the project
|
||||
func (b *BaseBuilder) CompileProject(options *Options) error {
|
||||
|
||||
// Run go mod tidy first
|
||||
cmd := exec.Command(options.Compiler, "mod", "tidy")
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Default go build command
|
||||
commands := slicer.String([]string{"build"})
|
||||
|
||||
|
|
@ -188,7 +195,7 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
|
|||
|
||||
// Get application build directory
|
||||
appDir := options.BuildDirectory
|
||||
err := cleanBuildDirectory(options)
|
||||
err = cleanBuildDirectory(options)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -211,7 +218,7 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
|
|||
options.CompiledBinary = compiledBinary
|
||||
|
||||
// Create the command
|
||||
cmd := exec.Command(options.Compiler, commands.AsSlice()...)
|
||||
cmd = exec.Command(options.Compiler, commands.AsSlice()...)
|
||||
|
||||
// Set the directory
|
||||
cmd.Dir = b.projectData.Path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue