printSkillInstallStatus surfaces every local install of the skill so the user can spot duplicate installs from multiple sources at a glance.
(name string)
| 763 | // printSkillInstallStatus surfaces every local install of the skill so the |
| 764 | // user can spot duplicate installs from multiple sources at a glance. |
| 765 | func (sh *SkillHandler) printSkillInstallStatus(name string) { |
| 766 | allInstalled := sh.registryMgr.GetAllInstalledInfo(name) |
| 767 | switch len(allInstalled) { |
| 768 | case 0: |
| 769 | fmt.Printf(" %s %s\n", |
| 770 | colorize(i18n.T("skill.info.status")+":", ColorCyan), |
| 771 | i18n.T("skill.not_installed")) |
| 772 | case 1: |
| 773 | inst := allInstalled[0] |
| 774 | fmt.Printf(" %s %s %s\n", |
| 775 | colorize(i18n.T("skill.info.status")+":", ColorCyan), |
| 776 | colorize(i18n.T("skill.installed"), ColorGreen), |
| 777 | colorize(fmt.Sprintf("[%s]", inst.Source), ColorGray)) |
| 778 | fmt.Printf(" %s %s\n", |
| 779 | colorize(i18n.T("skill.info.path")+":", ColorCyan), |
| 780 | colorize(inst.Path, ColorGray)) |
| 781 | default: |
| 782 | fmt.Printf(" %s %s\n", |
| 783 | colorize(i18n.T("skill.info.status")+":", ColorCyan), |
| 784 | colorize(fmt.Sprintf("%s (%d %s)", |
| 785 | i18n.T("skill.installed"), len(allInstalled), i18n.T("skill.info.sources")), |
| 786 | ColorYellow)) |
| 787 | for _, inst := range allInstalled { |
| 788 | fmt.Printf(" %s %s %s\n", |
| 789 | colorize(inst.Name, ColorCyan), |
| 790 | colorize(fmt.Sprintf("[%s]", inst.Source), ColorGray), |
| 791 | colorize(inst.Path, ColorGray)) |
| 792 | } |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | // printInfoRow renders a "label: value" row when value is non-empty; no-op |
| 797 | // otherwise. Centralizes the prefix/colorize/i18n boilerplate. |
no test coverage detected