mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 04:29:35 +08:00
Speed up Wails Serve
This commit is contained in:
parent
c4a042cb1d
commit
2d5825d73d
@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/leaanthony/spinner"
|
||||
"github.com/wailsapp/wails/cmd"
|
||||
@ -42,40 +41,6 @@ func init() {
|
||||
return err
|
||||
}
|
||||
|
||||
// Validate config
|
||||
// Check if we have a frontend
|
||||
err = cmd.ValidateFrontendConfig(projectOptions)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Program checker
|
||||
program := cmd.NewProgramHelper()
|
||||
|
||||
if projectOptions.FrontEnd != nil {
|
||||
// npm
|
||||
if !program.IsInstalled("npm") {
|
||||
return fmt.Errorf("it appears npm is not installed. Please install and run again")
|
||||
}
|
||||
}
|
||||
|
||||
// Save project directory
|
||||
projectDir := fs.Cwd()
|
||||
|
||||
// Install deps
|
||||
if projectOptions.FrontEnd != nil {
|
||||
err = cmd.InstallFrontendDeps(projectDir, projectOptions, forceRebuild, "serve")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Move to project directory
|
||||
err = os.Chdir(projectDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Install dependencies
|
||||
err = cmd.InstallGoDependencies()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user