mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 03:40:45 +08:00
Merge pull request #35 from wailsapp/Make-Serve-command
Add helpful message after serving
This commit is contained in:
commit
243d738d64
@ -20,6 +20,7 @@ type frontend struct {
|
|||||||
Install string `json:"install"`
|
Install string `json:"install"`
|
||||||
Build string `json:"build"`
|
Build string `json:"build"`
|
||||||
Bridge string `json:"bridge"`
|
Bridge string `json:"bridge"`
|
||||||
|
Serve string `json:"serve"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type framework struct {
|
type framework struct {
|
||||||
@ -274,6 +275,7 @@ func (po *ProjectOptions) PromptForInputs() error {
|
|||||||
}
|
}
|
||||||
po.FrontEnd.Build = templateMetadata["build"].(string)
|
po.FrontEnd.Build = templateMetadata["build"].(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
if templateMetadata["bridge"] != nil {
|
if templateMetadata["bridge"] != nil {
|
||||||
if po.FrontEnd == nil {
|
if po.FrontEnd == nil {
|
||||||
return fmt.Errorf("bridge set in template metadata but not frontenddir")
|
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)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,5 +7,6 @@
|
|||||||
"frontenddir": "frontend",
|
"frontenddir": "frontend",
|
||||||
"install": "npm install",
|
"install": "npm install",
|
||||||
"build": "npm run build",
|
"build": "npm run build",
|
||||||
|
"serve": "npm run serve",
|
||||||
"bridge": "src"
|
"bridge": "src"
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/leaanthony/slicer"
|
"github.com/leaanthony/slicer"
|
||||||
"github.com/leaanthony/spinner"
|
"github.com/leaanthony/spinner"
|
||||||
@ -216,6 +217,10 @@ func init() {
|
|||||||
|
|
||||||
// Run the App
|
// Run the App
|
||||||
logger.Yellow("Awesome! Project '%s' built!", projectOptions.Name)
|
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)
|
logger.Yellow("Serving Application: " + projectOptions.BinaryName)
|
||||||
cmd := exec.Command(projectOptions.BinaryName)
|
cmd := exec.Command(projectOptions.BinaryName)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user