fix: mise env set global

This commit is contained in:
engigu
2026-03-18 09:25:22 +08:00
parent 0f3ffea1b6
commit a12c5887bf
+4 -1
View File
@@ -195,9 +195,12 @@ func (s *MiseService) Versions(plugin string) ([]string, error) {
func (s *MiseService) enrichInstallDates(languages []MiseLanguage) { func (s *MiseService) enrichInstallDates(languages []MiseLanguage) {
for i := range languages { for i := range languages {
// 判断是否是 global // 判断是否是 global
path := strings.ToLower(languages[i].Source.Path)
// 归一化路径分隔符
normPath := strings.ReplaceAll(path, "\\", "/")
if languages[i].Source.Type == "global" { if languages[i].Source.Type == "global" {
languages[i].IsGlobal = true languages[i].IsGlobal = true
} else if strings.Contains(languages[i].Source.Path, ".config/mise/config.toml") { } else if strings.Contains(normPath, "mise/config.toml") {
languages[i].IsGlobal = true languages[i].IsGlobal = true
} }