MCPcopy Create free account
hub / github.com/auth0/auth0-cli / deduplicateResourceNames

Function deduplicateResourceNames

internal/cli/terraform.go:422–436  ·  view source on GitHub ↗
(data importDataList)

Source from the content-addressed store, hash-verified

420}
421
422func deduplicateResourceNames(data importDataList) importDataList {
423 nameMap := map[string]int{}
424 deduplicatedList := importDataList{}
425
426 for _, resource := range data {
427 nameMap[resource.ResourceName]++
428 if nameMap[resource.ResourceName] > 1 {
429 resource.ResourceName = fmt.Sprintf("%s_%d", resource.ResourceName, nameMap[resource.ResourceName])
430 }
431
432 deduplicatedList = append(deduplicatedList, resource)
433 }
434
435 return deduplicatedList
436}
437
438func checkOutputDirectoryIsEmpty(cli *cli, cmd *cobra.Command, outputDIR string) bool {
439 _, err := os.Stat(outputDIR)

Callers 2

fetchImportDataFunction · 0.85

Calls

no outgoing calls

Tested by 1