diff --git a/cmd/project.go b/cmd/project.go index 0e36f3b39..711dba261 100644 --- a/cmd/project.go +++ b/cmd/project.go @@ -20,6 +20,7 @@ type frontend struct { Install string `json:"install"` Build string `json:"build"` Bridge string `json:"bridge"` + Serve string `json:"serve"` } type framework struct { @@ -274,6 +275,7 @@ func (po *ProjectOptions) PromptForInputs() error { } po.FrontEnd.Build = templateMetadata["build"].(string) } + if templateMetadata["bridge"] != nil { if po.FrontEnd == nil { return fmt.Errorf("bridge set in template metadata but not frontenddir") @@ -281,6 +283,13 @@ func (po *ProjectOptions) PromptForInputs() error { po.FrontEnd.Bridge = templateMetadata["bridge"].(string) } + if templateMetadata["serve"] != nil { + if po.FrontEnd == nil { + return fmt.Errorf("serve set in template metadata but not frontenddir") + } + po.FrontEnd.Serve = templateMetadata["serve"].(string) + } + return nil } diff --git a/cmd/templates/vuewebpack/template.json b/cmd/templates/vuewebpack/template.json index 09fdffaad..6043205ee 100644 --- a/cmd/templates/vuewebpack/template.json +++ b/cmd/templates/vuewebpack/template.json @@ -7,5 +7,6 @@ "frontenddir": "frontend", "install": "npm install", "build": "npm run build", + "serve": "npm run serve", "bridge": "src" } diff --git a/cmd/wails/6_serve.go b/cmd/wails/6_serve.go index 37eb7b7e0..5daf19f36 100644 --- a/cmd/wails/6_serve.go +++ b/cmd/wails/6_serve.go @@ -6,6 +6,7 @@ import ( "path" "path/filepath" "runtime" + "time" "github.com/leaanthony/slicer" "github.com/leaanthony/spinner" @@ -216,6 +217,10 @@ func init() { // Run the App logger.Yellow("Awesome! Project '%s' built!", projectOptions.Name) + go func() { + time.Sleep(2 * time.Second) + logger.Green(">>>>> To connect, you will need to run '" + projectOptions.FrontEnd.Serve + "' in the '" + projectOptions.FrontEnd.Dir + "' directory <<<<<") + }() logger.Yellow("Serving Application: " + projectOptions.BinaryName) cmd := exec.Command(projectOptions.BinaryName) cmd.Stdout = os.Stdout