mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-16 07:56:12 +00:00
Improve motherboard module
This commit is contained in:
+8
-1
@@ -152,10 +152,17 @@ func initializeModuleMap() {
|
||||
|
||||
// Motherboard module
|
||||
MotherboardModule := StormfetchModule{stormfetchModuleConfig: stormfetchModuleConfig{Name: "motherboard", Format: "%3Motherboard: %4$MOTHERBOARD"}, Execute: func(sm StormfetchModule) string {
|
||||
motherboard := GetMotherboardModel()
|
||||
|
||||
// Return empty string if can't detect motherboard model
|
||||
if motherboard == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
return os.Expand(sm.Format, func(s string) string {
|
||||
switch s {
|
||||
case "MOTHERBOARD":
|
||||
return GetMotherboardModel()
|
||||
return motherboard
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user