installDirName is the on-disk directory name used when the item is installed. It prefers the item Name (matching entities.InstallToApp) and falls back to the repo name portion of the install key.
(item Item)
| 574 | // It prefers the item Name (matching entities.InstallToApp) and falls back to the |
| 575 | // repo name portion of the install key. |
| 576 | func installDirName(item Item) string { |
| 577 | if item.Name != "" { |
| 578 | return item.Name |
| 579 | } |
| 580 | parts := strings.Split(item.InstallKey, ":") |
| 581 | key := parts[0] |
| 582 | if slash := strings.LastIndex(key, "/"); slash >= 0 { |
| 583 | return key[slash+1:] |
| 584 | } |
| 585 | return key |
| 586 | } |
| 587 | |
| 588 | // repoEntry mirrors the JSON shape used in *_repos.json files. |
| 589 | type repoEntry struct { |