fix(internal): fix googleapis-disco regen (#4354)
diff --git a/internal/gapicgen/generator/gapics.go b/internal/gapicgen/generator/gapics.go
index 48a16e6..e57315a 100644
--- a/internal/gapicgen/generator/gapics.go
+++ b/internal/gapicgen/generator/gapics.go
@@ -491,7 +491,11 @@
entries[manual.DistributionName] = manual
}
for _, conf := range confs {
- yamlPath := filepath.Join(g.googleapisDir, conf.apiServiceConfigPath)
+ dir := g.googleapisDir
+ if conf.googleapisDiscovery {
+ dir = g.googleapisDiscoDir
+ }
+ yamlPath := filepath.Join(dir, conf.apiServiceConfigPath)
yamlFile, err := os.Open(yamlPath)
if err != nil {
return err
@@ -535,7 +539,11 @@
func (g *GapicGenerator) parseAPIShortnames(confs []*microgenConfig, manualEntries []manifestEntry) (map[string]string, error) {
shortnames := map[string]string{}
for _, conf := range confs {
- yamlPath := filepath.Join(g.googleapisDir, conf.apiServiceConfigPath)
+ dir := g.googleapisDir
+ if conf.googleapisDiscovery {
+ dir = g.googleapisDiscoDir
+ }
+ yamlPath := filepath.Join(dir, conf.apiServiceConfigPath)
yamlFile, err := os.Open(yamlPath)
if err != nil {
return nil, err