Skip to content

Commit aeea1ce

Browse files
authored
fix(internal): fix googleapis-disco regen (#4354)
1 parent cfee361 commit aeea1ce

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

internal/gapicgen/generator/gapics.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,11 @@ func (g *GapicGenerator) manifest(confs []*microgenConfig) error {
491491
entries[manual.DistributionName] = manual
492492
}
493493
for _, conf := range confs {
494-
yamlPath := filepath.Join(g.googleapisDir, conf.apiServiceConfigPath)
494+
dir := g.googleapisDir
495+
if conf.googleapisDiscovery {
496+
dir = g.googleapisDiscoDir
497+
}
498+
yamlPath := filepath.Join(dir, conf.apiServiceConfigPath)
495499
yamlFile, err := os.Open(yamlPath)
496500
if err != nil {
497501
return err
@@ -535,7 +539,11 @@ func (g *GapicGenerator) copyMicrogenFiles() error {
535539
func (g *GapicGenerator) parseAPIShortnames(confs []*microgenConfig, manualEntries []manifestEntry) (map[string]string, error) {
536540
shortnames := map[string]string{}
537541
for _, conf := range confs {
538-
yamlPath := filepath.Join(g.googleapisDir, conf.apiServiceConfigPath)
542+
dir := g.googleapisDir
543+
if conf.googleapisDiscovery {
544+
dir = g.googleapisDiscoDir
545+
}
546+
yamlPath := filepath.Join(dir, conf.apiServiceConfigPath)
539547
yamlFile, err := os.Open(yamlPath)
540548
if err != nil {
541549
return nil, err

0 commit comments

Comments
 (0)