feat: rorkos support

This commit is contained in:
nekohepott 2026-06-17 04:16:35 +03:00
parent d9c3b47dc9
commit fa5f941418
No known key found for this signature in database
2 changed files with 17 additions and 7 deletions

View File

@ -15,7 +15,7 @@ import (
var ansiEscapeRe = regexp.MustCompile(`\x1b\[[0-9;?]*[ -/]*[@-~]`)
func GetLogo(id string, conf Config, ascii *bool) string {
knownIDs := []string{"arch", "nixos", "debian", "alpine", "gentoo", "void", "chimera", "cachyos", "artix", "endeavouros", "fedora", "kali", "linuxmint", "manjaro", "ubuntu", "opensuse"}
knownIDs := []string{"arch", "nixos", "debian", "alpine", "gentoo", "void", "chimera", "cachyos", "artix", "endeavouros", "fedora", "kali", "linuxmint", "manjaro", "ubuntu", "opensuse", "rorkos"}
if slices.Contains(knownIDs, id) {
if conf.Ascii || (ascii != nil && *ascii) == true {
return path.Join("logos", id+".txt")

View File

@ -16,12 +16,13 @@ func pathExists(path string) bool {
func getPmPackages(packagerName string, packagerPath string) string {
if pathExists(packagerPath) {
pkgs, err := os.ReadDir(packagerPath)
if err != nil {
return "error reading " + packagerPath
}
if packagerName == "pacman" {
return strconv.Itoa(len(pkgs)-1) + " (pacman)"
if packagerName == "ror" {
file, err := os.ReadFile(packagerPath)
if err != nil {
return "error reading ror file"
}
count := strings.Count(string(file), "\"") / 2
return strconv.Itoa(count) + " (ror)"
}
if packagerName == "apk" {
out, err := exec.Command("apk", "info").Output()
@ -39,6 +40,14 @@ func getPmPackages(packagerName string, packagerPath string) string {
return fmt.Sprintf("%d (apk)", pkgCount)
}
pkgs, err := os.ReadDir(packagerPath)
if err != nil {
return "error reading " + packagerPath
}
if packagerName == "pacman" {
return strconv.Itoa(len(pkgs)-1) + " (pacman)"
}
if packagerName == "emerge" {
count := 0
for _, cat := range pkgs {
@ -70,6 +79,7 @@ func GetPkgs() string {
{"pacman", "/var/lib/pacman/local"},
{"nix-user", os.Getenv("HOME") + "/.local/state/nix/profiles/profile/bin"},
{"nix", "/run/current-system/sw/bin"},
{"ror", "/etc/ror/installed.json"},
{"apt", "/var/lib/apt"},
{"dnf", "/var/lib/dnf"},
{"zypper", "/var/lib/zypp"},