diff --git a/v2/cmd/wails/internal/commands/build/build.go b/v2/cmd/wails/internal/commands/build/build.go index 3a3aae929..1c26c49ad 100644 --- a/v2/cmd/wails/internal/commands/build/build.go +++ b/v2/cmd/wails/internal/commands/build/build.go @@ -183,21 +183,24 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { w.Init(os.Stdout, 8, 8, 0, '\t', 0) // Write out the system information - fmt.Fprintf(w, "App Type: \t%s\n", buildOptions.OutputType) - fmt.Fprintf(w, "Platforms: \t%s\n", platform) - fmt.Fprintf(w, "Compiler: \t%s\n", compilerPath) - fmt.Fprintf(w, "Build Mode: \t%s\n", modeString) - fmt.Fprintf(w, "Skip Frontend: \t%t\n", skipFrontend) - fmt.Fprintf(w, "Compress: \t%t\n", buildOptions.Compress) - fmt.Fprintf(w, "Package: \t%t\n", buildOptions.Pack) - fmt.Fprintf(w, "Clean Build Dir: \t%t\n", buildOptions.CleanBuildDirectory) - fmt.Fprintf(w, "LDFlags: \t\"%s\"\n", buildOptions.LDFlags) - fmt.Fprintf(w, "Tags: \t[%s]\n", strings.Join(buildOptions.UserTags, ",")) + _, _ = fmt.Fprintf(w, "App Type: \t%s\n", buildOptions.OutputType) + _, _ = fmt.Fprintf(w, "Platforms: \t%s\n", platform) + _, _ = fmt.Fprintf(w, "Compiler: \t%s\n", compilerPath) + _, _ = fmt.Fprintf(w, "Build Mode: \t%s\n", modeString) + _, _ = fmt.Fprintf(w, "Skip Frontend: \t%t\n", skipFrontend) + _, _ = fmt.Fprintf(w, "Compress: \t%t\n", buildOptions.Compress) + _, _ = fmt.Fprintf(w, "Package: \t%t\n", buildOptions.Pack) + _, _ = fmt.Fprintf(w, "Clean Build Dir: \t%t\n", buildOptions.CleanBuildDirectory) + _, _ = fmt.Fprintf(w, "LDFlags: \t\"%s\"\n", buildOptions.LDFlags) + _, _ = fmt.Fprintf(w, "Tags: \t[%s]\n", strings.Join(buildOptions.UserTags, ",")) if len(buildOptions.OutputFile) > 0 && targets.Length() == 1 { - fmt.Fprintf(w, "Output File: \t%s\n", buildOptions.OutputFile) + _, _ = fmt.Fprintf(w, "Output File: \t%s\n", buildOptions.OutputFile) + } + _, _ = fmt.Fprintf(w, "\n") + err = w.Flush() + if err != nil { + return err } - fmt.Fprintf(w, "\n") - w.Flush() err = checkGoModVersion(logger, updateGoMod) if err != nil { @@ -303,6 +306,10 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { } buildOptions.OutputFile = desiredFilename + if outputFilename != "" { + buildOptions.OutputFile = outputFilename + } + // Start Time start := time.Now()