generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d83cd54
commit f2d299a
Showing
2 changed files
with
113 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
"fmt" | ||
"os" | ||
"strings" | ||
|
||
"github.com/hashicorp/terraform-provider-awscc/internal/provider/generators/schema_rename/rename" | ||
"path/filepath" | ||
"strings" | ||
|
||
"github.com/hashicorp/terraform-provider-awscc/internal/provider/generators/schema_rename/rename" | ||
) | ||
|
||
func main() { | ||
baseDir := "./internal/service/cloudformation/schemas/" | ||
err := filepath.Walk(baseDir, func(path string, info os.FileInfo, err error) error { | ||
if err != nil { | ||
return err | ||
} | ||
baseDir := "./internal/service/cloudformation/schemas/" | ||
err := filepath.Walk(baseDir, func(path string, info os.FileInfo, err error) error { | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if !info.IsDir() && filepath.Ext(path) == ".json" { | ||
generator := rename.NewGenerator() | ||
// Skip files that start with "AWS_CloudFormation_" | ||
if !strings.HasPrefix(info.Name(), "AWS_CloudFormation_") { | ||
err = generator.RenameCfnSchemaFile(path) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
} | ||
if !info.IsDir() && filepath.Ext(path) == ".json" { | ||
generator := rename.NewGenerator() | ||
// Skip files that start with "AWS_CloudFormation_" | ||
if !strings.HasPrefix(info.Name(), "AWS_CloudFormation_") { | ||
err = generator.RenameCfnSchemaFile(path) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
} | ||
|
||
return nil | ||
}) | ||
return nil | ||
}) | ||
|
||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error: %v", err) | ||
} | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error: %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters