[v2] Fix dev build when no dev command in project

This commit is contained in:
Lea Anthony
2021-11-08 21:01:42 +11:00
parent bcad236fb6
commit e651b9c7ff

View File

@@ -17,6 +17,7 @@ import (
"github.com/pkg/errors"
"github.com/leaanthony/slicer"
"github.com/ryboe/q"
"github.com/wailsapp/wails/v2/internal/assetdb"
"github.com/wailsapp/wails/v2/internal/fs"
"github.com/wailsapp/wails/v2/internal/html"
@@ -527,11 +528,16 @@ func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error {
outputLogger.Println("Done.")
}
q.Q(b.projectData)
// Check if there is a build command
var buildCommand string
switch b.projectData.OutputType {
case "dev":
buildCommand = b.projectData.DevCommand
if buildCommand == "" {
buildCommand = b.projectData.BuildCommand
}
default:
buildCommand = b.projectData.BuildCommand
}