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:
parent
501f7a129e
commit
833b6bdbb8
@ -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.
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user