5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 03:52:41 +08:00

Feature: Don't generate models.ts if there are no models.

This commit is contained in:
Lea Anthony 2022-04-05 20:28:26 +10:00
parent f192cbd01b
commit eb97f53124

View File

@ -109,6 +109,11 @@ func (b *Bindings) WriteModels(modelsDir string) error {
modelsData.WriteString("\n}\n\n")
}
// Don't write if we don't have anything
if len(modelsData.Bytes()) == 0 {
return nil
}
filename := filepath.Join(modelsDir, "models.ts")
err := os.WriteFile(filename, modelsData.Bytes(), 0755)
if err != nil {