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

This commit is contained in:
Lea Anthony
2022-04-05 21:30:55 +10:00
parent f192cbd01b
commit eb97f53124
+5
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 {