2022-09-25 20:50:20 +02:00
|
|
|
package asciiarts
|
|
|
|
|
|
|
|
import (
|
2022-10-14 22:09:19 +02:00
|
|
|
"embed"
|
2022-09-25 20:50:20 +02:00
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2022-10-14 22:09:19 +02:00
|
|
|
//go:embed *.txt
|
|
|
|
var asciifiles embed.FS
|
2022-09-25 20:50:20 +02:00
|
|
|
|
|
|
|
func GetAscii(distroID string) string {
|
2022-10-14 22:09:19 +02:00
|
|
|
asciiBuff, error := asciifiles.ReadFile(distroID + ".txt")
|
|
|
|
if error != nil {
|
|
|
|
asciiBuff, _ = asciifiles.ReadFile("unknown.txt")
|
|
|
|
}
|
|
|
|
ascii := string(asciiBuff)
|
2022-09-25 20:50:20 +02:00
|
|
|
ascii = strings.ReplaceAll(ascii, "{WHITE}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{YELLOW}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{BLUE}", "")
|
2022-09-26 09:13:21 +02:00
|
|
|
ascii = strings.ReplaceAll(ascii, "{LPINK}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{BACKGROUND_GREEN}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{NORMAL}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{BLACK}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{GREEN}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{RED}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{PINK}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{MAGENTA}", "")
|
|
|
|
ascii = strings.ReplaceAll(ascii, "{CYAN}", "")
|
2022-09-25 20:50:20 +02:00
|
|
|
return ascii
|
|
|
|
}
|