feat: define preload file in var

same as before, enables changing at compile time
pull/60/head
sammyette 2021-06-08 21:00:31 -04:00
parent be5ebd6ada
commit e37abcb08b
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
2 changed files with 2 additions and 2 deletions

2
lua.go
View File

@ -62,7 +62,7 @@ func LuaInit() {
err := l.DoFile("preload.lua")
if err != nil {
err = l.DoFile("/usr/share/hilbish/preload.lua")
err = l.DoFile(preloadPath)
if err != nil {
fmt.Fprintln(os.Stderr,
"Missing preload file, builtins may be missing.")

View File

@ -9,6 +9,7 @@ var (
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?/init.lua;'
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?/?.lua;'
.. os.getenv 'HOME' .. '/.local/share/hilbish/libs/?.lua'`
preloadPath = "/usr/share/hilbish/preload.lua"
prompt string // Prompt will always get changed anyway
multilinePrompt = "> "
@ -20,6 +21,5 @@ var (
interactive bool
login bool // Are we the login shell?
noexecute bool // Should we run Lua or only report syntax errors
)