Skip to content

Commit

Permalink
chore: fix new module bug (#8005)
Browse files Browse the repository at this point in the history
Partial revert of #7904. If the module does not exist yet the old
code yeilded the root module and messed up automation. All v2 mods
have been migrated to in-place so this should be a safe assumption.
  • Loading branch information
codyoss committed May 30, 2023
1 parent 171c1e6 commit 848765c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/postprocessor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@ func (p *postProcessor) InitializeNewModules(manifest map[string]ManifestEntry)
log.Println("checking for new modules and clients")
for _, moduleName := range p.config.Modules {
modulePath := filepath.Join(p.googleCloudDir, moduleName)
importPath, err := gocmd.ListModName(modulePath)
if err != nil {
return err
}
importPath := filepath.Join("cloud.google.com/go", moduleName)

pathToModVersionFile := filepath.Join(modulePath, "internal/version.go")
// Check if <module>/internal/version.go file exists
Expand All @@ -207,7 +204,7 @@ func (p *postProcessor) InitializeNewModules(manifest map[string]ManifestEntry)
}
}
// Check if version.go files exist for each client
err = filepath.WalkDir(modulePath, func(path string, d fs.DirEntry, err error) error {
err := filepath.WalkDir(modulePath, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand Down

0 comments on commit 848765c

Please sign in to comment.