1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-10 07:25:37 -05:00
Files
DankMaterialShell/core/internal/server/plugins/utils.go
2025-11-12 23:12:31 -05:00

18 lines
432 B
Go

package plugins
import (
"sort"
"strings"
)
func SortPluginInfoByFirstParty(pluginInfos []PluginInfo) {
sort.SliceStable(pluginInfos, func(i, j int) bool {
isFirstPartyI := strings.HasPrefix(pluginInfos[i].Repo, "https://github.com/AvengeMedia")
isFirstPartyJ := strings.HasPrefix(pluginInfos[j].Repo, "https://github.com/AvengeMedia")
if isFirstPartyI != isFirstPartyJ {
return isFirstPartyI
}
return false
})
}