по заветам хохолоса
This commit is contained in:
parent
5ec255982b
commit
5855e573a9
23
main.go
23
main.go
@ -151,9 +151,11 @@ func getPkgs() string {
|
|||||||
return pkgs
|
return pkgs
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(dist, "NixOS") {
|
if strings.HasPrefix(dist, "NixOS") {
|
||||||
out, _ := exec.Command("sh", "-c", "nix-env -qa --installed | wc -l").Output()
|
entries, err := os.ReadDir("/run/current-system/sw/bin")
|
||||||
pkgs = strings.TrimSpace(string(out)) + " (nix)"
|
if err != nil {
|
||||||
return pkgs
|
return "can't get nix packages"
|
||||||
|
}
|
||||||
|
return string(rune(len(entries))) + " (nix)"
|
||||||
}
|
}
|
||||||
return "unknown"
|
return "unknown"
|
||||||
}
|
}
|
||||||
@ -161,26 +163,17 @@ func getPkgs() string {
|
|||||||
func getAscii() string {
|
func getAscii() string {
|
||||||
var ascii string
|
var ascii string
|
||||||
if strings.HasPrefix(dist, "Arch") {
|
if strings.HasPrefix(dist, "Arch") {
|
||||||
content, err := os.ReadFile("ascii/arch.txt")
|
content := " _ _ _\n /\\ | | | | (_)\n / \\ _ __ ___| |__ | | _ _ __ _ ___ __\n / /\\ \\ | '__/ __| '_ \\ | | | | '_ \\| | | \\ \\/ /\n / ____ \\| | | (__| | | | | |____| | | | | |_| |> <\n /_/ \\_\\_| \\___|_| |_| |______|_|_| |_|\\__,_/_/\\_\\\n"
|
||||||
if err != nil {
|
|
||||||
return "no ascii, but thats arch btw\n"
|
|
||||||
}
|
|
||||||
ascii = fmt.Sprintf(string(content))
|
ascii = fmt.Sprintf(string(content))
|
||||||
return ascii
|
return ascii
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(dist, "Debian") {
|
if strings.HasPrefix(dist, "Debian") {
|
||||||
content, err := os.ReadFile("ascii/debian.txt")
|
content := " _____ _ _\n | __ \\ | | (_)\n | | | | ___ | |__ _ __ _ _ __\n | | | | / _ \\ | '_ \\ | | / _` | | '_ \\\n | |__| | | __/ | |_) | | | | (_| | | | | |\n |_____/ \\___| |_.__/ |_| \\__,_| |_| |_|\n"
|
||||||
if err != nil {
|
|
||||||
return "no ascii, but thats necrokall\n"
|
|
||||||
}
|
|
||||||
ascii = fmt.Sprintf(string(content))
|
ascii = fmt.Sprintf(string(content))
|
||||||
return ascii
|
return ascii
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(dist, "NixOS") {
|
if strings.HasPrefix(dist, "NixOS") {
|
||||||
content, err := os.ReadFile("ascii/nix.txt")
|
content := " _ _ _ ____ _____\n | \\ | (_) / __ \\ / ____|\n | \\| |___ _| | | | (___\n | . ` | \\ \\/ / | | |\\___ \\\n | |\\ | |> <| |__| |____) |\n |_| \\_|_/_/\\_\\\\____/|_____/\n"
|
||||||
if err != nil {
|
|
||||||
return "no ascii, but thats NIX POBEDA\n"
|
|
||||||
}
|
|
||||||
ascii = fmt.Sprintf(string(content))
|
ascii = fmt.Sprintf(string(content))
|
||||||
return ascii
|
return ascii
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user