2
3
зеркало из https://github.com/sammy-ette/Hilbish synced 2025-08-10 02:52:03 +00:00

fix: stop using setField wrapper

Этот коммит содержится в:
sammyette 2021-10-16 15:40:08 -04:00
родитель afd999a7b0
Коммит 4dd6db54fe
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 50EE40A2809851F5

Просмотреть файл

@ -8,6 +8,8 @@ import (
"runtime" "runtime"
"strings" "strings"
"hilbish/util"
"github.com/pborman/getopt" "github.com/pborman/getopt"
"github.com/yuin/gopher-lua" "github.com/yuin/gopher-lua"
"mvdan.cc/sh/v3/interp" "mvdan.cc/sh/v3/interp"
@ -29,17 +31,17 @@ func HilbishLoader(L *lua.LState) int {
username = strings.Split(username, "\\")[1] // for some reason Username includes the hostname on windows username = strings.Split(username, "\\")[1] // for some reason Username includes the hostname on windows
} }
setField(L, mod, "ver", lua.LString(version), "The version of Hilbish") L.SetField(mod, "ver", lua.LString(version))
setField(L, mod, "user", lua.LString(username), "Current user's username") L.SetField(mod, "user", lua.LString(username))
setField(L, mod, "host", lua.LString(host), "Hostname of the system") L.SetField(mod, "host", lua.LString(host))
setField(L, mod, "home", lua.LString(homedir), "Path of home directory") L.SetField(mod, "home", lua.LString(homedir))
setField(L, mod, "dataDir", lua.LString(dataDir), "Path of Hilbish's data files")
xdg := L.NewTable() xdg := L.NewTable()
setField(L, xdg, "config", lua.LString(confDir), "XDG config directory") L.SetField(xdg, "config", lua.LString(confDir))
setField(L, xdg, "data", lua.LString(getenv("XDG_DATA_HOME", homedir + "/.local/share/")), "XDG data directory") L.SetField(xdg, "data", lua.LString(getenv("XDG_DATA_HOME", homedir + "/.local/share/")))
setField(L, mod, "xdg", xdg, "XDG values for Linux") L.SetField(mod, "xdg", xdg)
util.Document(L, mod, "A miscellaneous sort of \"core\" API for things that relate to the shell itself and others.")
L.Push(mod) L.Push(mod)
return 1 return 1