5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 21:10:54 +08:00
This commit is contained in:
Lea Anthony 2022-04-27 21:29:54 +10:00
parent a8357a2459
commit 41f9c07c88
3 changed files with 12 additions and 1 deletions

View File

@ -220,6 +220,10 @@ func generateBindings(bindings *binding.Bindings) error {
return err
}
if projectConfig.WailsJSDir == "" {
projectConfig.WailsJSDir = filepath.Join(cwd, "frontend")
}
targetDir := filepath.Join(projectConfig.WailsJSDir, "wailsjs", "go")
err = os.RemoveAll(targetDir)
if err != nil {

View File

@ -383,8 +383,13 @@ Please reinstall by doing the following:
}
func generateRuntimeWrapper(options *Options) error {
if options.WailsJSDir == "" {
options.WailsJSDir = filepath.Join("./frontend")
cwd, err := os.Getwd()
if err != nil {
return err
}
options.WailsJSDir = filepath.Join(cwd, "frontend")
}
wrapperDir := filepath.Join(options.WailsJSDir, "wailsjs", "runtime")
_ = os.RemoveAll(wrapperDir)

View File

@ -85,6 +85,8 @@ func Build(options *Options) (string, error) {
// wails js dir
if projectData.WailsJSDir != "" {
options.WailsJSDir = projectData.WailsJSDir
} else {
options.WailsJSDir = filepath.Join(cwd, "frontend")
}
// Set build directory