Skip to content

Commit

Permalink
[ignore] Only clean up annotation_unsupported.go when GEN_ANNOTATION_…
Browse files Browse the repository at this point in the history
…UNSUPPORTED is set.
  • Loading branch information
samiib authored and lhercot committed Mar 6, 2024
1 parent 2e184c6 commit 5c22fae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func migrateLegacyDocumentation() {
// Container function to clean all directories properly
func cleanDirectories() {
cleanDirectory(docsPath, []string{"resources", "data-sources"})
cleanDirectory(providerPath, []string{"provider_test.go", "utils.go", "test_constants.go", "resource_aci_rest_managed.go", "resource_aci_rest_managed_test.go", "data_source_aci_rest_managed.go", "data_source_aci_rest_managed_test.go"})
cleanDirectory(providerPath, []string{"provider_test.go", "utils.go", "test_constants.go", "resource_aci_rest_managed.go", "resource_aci_rest_managed_test.go", "data_source_aci_rest_managed.go", "data_source_aci_rest_managed_test.go", "annotation_unsupported.go"})
cleanDirectory(resourcesDocsPath, []string{})
cleanDirectory(datasourcesDocsPath, []string{})
cleanDirectory(testVarsPath, []string{})
Expand Down Expand Up @@ -514,6 +514,10 @@ func main() {
renderTemplate("provider.go.tmpl", "provider.go", providerPath, classModels)
renderTemplate("index.md.tmpl", "index.md", docsPath, ProviderModel{Example: string(getExampleCode(providerExamplePath))})
if len(annotationUnsupported) > 0 {
err := os.Remove(filepath.Join(providerPath, "annotation_unsupported.go"))
if err != nil {
panic(err)
}
renderTemplate("annotation_unsupported.go.tmpl", "annotation_unsupported.go", providerPath, annotationUnsupported)
}
for _, model := range classModels {
Expand Down

0 comments on commit 5c22fae

Please sign in to comment.