2022-12-15 04:00:54 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-07-19 20:54:15 +00:00
|
|
|
"hilbish/moonlight"
|
|
|
|
//"hilbish/util"
|
2022-12-15 04:00:54 +00:00
|
|
|
|
|
|
|
rt "github.com/arnodel/golua/runtime"
|
|
|
|
"github.com/blackfireio/osinfo"
|
|
|
|
)
|
|
|
|
|
|
|
|
// #interface os
|
2023-12-26 03:08:29 +00:00
|
|
|
// operating system info
|
|
|
|
// Provides simple text information properties about the current operating system.
|
|
|
|
// This mainly includes the name and version.
|
2022-12-15 04:00:54 +00:00
|
|
|
// #field family Family name of the current OS
|
|
|
|
// #field name Pretty name of the current OS
|
|
|
|
// #field version Version of the current OS
|
2024-07-19 20:54:15 +00:00
|
|
|
func hshosLoader() *moonlight.Table {
|
2022-12-15 04:00:54 +00:00
|
|
|
info, _ := osinfo.GetOSInfo()
|
2024-07-19 20:54:15 +00:00
|
|
|
mod := moonlight.NewTable()
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2024-07-19 20:54:15 +00:00
|
|
|
mod.SetField("family", rt.StringValue(info.Family))
|
|
|
|
mod.SetField("name", rt.StringValue(info.Name))
|
|
|
|
mod.SetField("version", rt.StringValue(info.Version))
|
2022-12-15 04:00:54 +00:00
|
|
|
|
|
|
|
return mod
|
|
|
|
}
|