Skip to content

Commit

Permalink
fix builder numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
blesswinsamuel committed Jun 27, 2024
1 parent 4b16e2b commit 16602ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func constructFilenameToApiObjectsMap(files map[string][]ApiObject, scope *scope
files[filePath] = append(files[filePath], scope.objects...)
case YamlOutputTypeFilePerResource:
for i, apiObject := range scope.objects {
filePath := fmt.Sprintf("%s-%02d-%s", strings.Join(currentScopeID, "-"), i+1, getObjectNameAndNamespace(apiObject))
filePath := strings.Join([]string{strings.Join(currentScopeID, "-"), sprintfWithNumber(i+1, getObjectNameAndNamespace(apiObject))}, "-")
files[filePath] = append(files[filePath], apiObject)
}
case YamlOutputTypeFilePerScope:
Expand All @@ -122,9 +122,9 @@ func constructFilenameToApiObjectsMap(files map[string][]ApiObject, scope *scope
files[filePath] = append(files[filePath], scope.objects...)
}
}
for i, childNode := range scope.children {
thisScopeID := append(currentScopeID, sprintfWithNumber(i+1, childNode.ID()))
constructFilenameToApiObjectsMap(files, childNode, thisScopeID, level+1, opts)
for i, childScope := range scope.children {
thisScopeID := append(currentScopeID, sprintfWithNumber(i+1, childScope.ID()))
constructFilenameToApiObjectsMap(files, childScope, thisScopeID, level+1, opts)
}
}

Expand Down

0 comments on commit 16602ff

Please sign in to comment.