Remove 'distro name' flag and config option

This commit is contained in:
2025-12-22 13:12:28 +02:00
parent 341138116b
commit 705a40047b
3 changed files with 5 additions and 8 deletions
+5 -6
View File
@@ -22,10 +22,6 @@ func GetDistroInfo() DistroInfo {
LongName: "Unknown",
ShortName: "Unknown",
}
if strings.TrimSpace(config.DistroName) != "" {
info.LongName = strings.TrimSpace(config.DistroName)
info.ShortName = strings.TrimSpace(config.DistroName)
}
// Detect release file location
var releaseFile string
@@ -39,20 +35,23 @@ func GetDistroInfo() DistroInfo {
return info
}
// Read release file
releaseMap, err := ReadKeyValueFile(releaseFile)
if err != nil {
return info
}
// Set struct fields
if id, ok := releaseMap["ID"]; ok {
info.ID = id
}
if longName, ok := releaseMap["PRETTY_NAME"]; ok && info.LongName == "Unknown" {
if longName, ok := releaseMap["PRETTY_NAME"]; ok {
info.LongName = longName
}
if shortName, ok := releaseMap["NAME"]; ok && info.ShortName == "Unknown" {
if shortName, ok := releaseMap["NAME"]; ok {
info.ShortName = shortName
}
return info
}