2022-12-05 22:57:59 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"hilbish/util"
|
|
|
|
|
|
|
|
rt "github.com/arnodel/golua/runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
// #interface userDir
|
|
|
|
// user-related directories
|
|
|
|
// This interface just contains properties to know about certain user directories.
|
|
|
|
// It is equivalent to XDG on Linux and gets the user's preferred directories
|
|
|
|
// for configs and data.
|
2022-12-14 00:12:16 +00:00
|
|
|
// #field config The user's config directory
|
|
|
|
// #field data The user's directory for program data
|
2022-12-05 22:57:59 +00:00
|
|
|
func userDirLoader(rtm *rt.Runtime) *rt.Table {
|
|
|
|
mod := rt.NewTable()
|
|
|
|
|
|
|
|
util.SetField(rtm, mod, "config", rt.StringValue(confDir), "User's config directory")
|
|
|
|
util.SetField(rtm, mod, "data", rt.StringValue(userDataDir), "XDG data directory")
|
|
|
|
|
|
|
|
return mod
|
|
|
|
}
|