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
+4
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 {
+6 -1
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)
+2
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