2022-09-25 20:50:20 +02:00
|
|
|
package asciiarts
|
|
|
|
|
|
|
|
import (
|
2022-10-14 22:09:19 +02:00
|
|
|
"embed"
|
2024-02-26 11:13:51 +01:00
|
|
|
"regexp"
|
2022-09-25 20:50:20 +02:00
|
|
|
)
|
|
|
|
|
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 {
|
2024-02-26 11:13:51 +01:00
|
|
|
regex, _ := regexp.Compile("{[[:upper:]]+}")
|
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)
|
2024-02-26 11:13:51 +01:00
|
|
|
ascii = regex.ReplaceAllString(ascii, "")
|
2022-09-25 20:50:20 +02:00
|
|
|
return ascii
|
|
|
|
}
|