Trim last newline character from ascii art

This commit is contained in:
2025-12-22 13:53:14 +02:00
parent b52145614f
commit 1b0ad32b6b
+2 -2
View File
@@ -80,7 +80,7 @@ func GetDistroAsciiArt() string {
if err == nil {
if _, err := os.Stat(path.Join(userConfDir, "stormfetch/ascii/", asciiName)); err == nil {
if bytes, err := os.ReadFile(path.Join(userConfDir, "stormfetch/ascii/", asciiName)); err == nil {
return string(bytes)
return strings.TrimRight(string(bytes), "\n")
}
}
}
@@ -88,7 +88,7 @@ func GetDistroAsciiArt() string {
// Check for ascii art in system config directory
if _, err := os.Stat(path.Join(SystemConfigDir, "stormfetch/ascii/", asciiName)); err == nil {
if bytes, err := os.ReadFile(path.Join(SystemConfigDir, "stormfetch/ascii/", asciiName)); err == nil {
return string(bytes)
return strings.TrimRight(string(bytes), "\n")
}
}