5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 03:09:17 +08:00

Merge pull request #1711

* [v2, dev] Improve error message for auto dev server discovery without…
This commit is contained in:
stffabi 2022-08-08 09:25:36 +02:00 committed by GitHub
parent 501f7a129e
commit 833b6bdbb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -198,8 +198,9 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
}
// frontend:dev:watcher command.
frontendDevAutoDiscovery := projectConfig.IsFrontendDevServerURLAutoDiscovery()
if command := projectConfig.DevWatcherCommand; command != "" {
closer, devServerURL, err := runFrontendDevWatcherCommand(cwd, command, projectConfig.FrontendDevServerURL == "auto")
closer, devServerURL, err := runFrontendDevWatcherCommand(cwd, command, frontendDevAutoDiscovery)
if err != nil {
return err
}
@ -208,6 +209,8 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
flags.frontendDevServerURL = devServerURL
}
defer closer()
} else if frontendDevAutoDiscovery {
return fmt.Errorf("Unable to auto discover frontend:dev:serverUrl without a frontend:dev:watcher command, please either set frontend:dev:watcher or remove the auto discovery from frontend:dev:serverUrl")
}
// Do initial build but only for the application.

View File

@ -103,6 +103,10 @@ func (p *Project) GetDevInstallerCommand() string {
return p.InstallCommand
}
func (p *Project) IsFrontendDevServerURLAutoDiscovery() bool {
return p.FrontendDevServerURL == "auto"
}
func (p *Project) Save() error {
data, err := json.MarshalIndent(p, "", " ")
if err != nil {