feat: print error if nature is missing

insensitive-tab^2
TorchedSammy 2022-05-06 19:21:32 -04:00
parent 200babf831
commit 0a01ed862c
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 6 additions and 4 deletions

10
lua.go
View File

@ -54,11 +54,13 @@ func luaInit() {
fmt.Fprintln(os.Stderr, "Could not add Hilbish require paths! Libraries will be missing. This shouldn't happen.") fmt.Fprintln(os.Stderr, "Could not add Hilbish require paths! Libraries will be missing. This shouldn't happen.")
} }
err = util.DoFile(l, "nature/init.lua") err1 := util.DoFile(l, "nature/init.lua")
if err != nil { if err1 != nil {
err = util.DoFile(l, preloadPath) err2 := util.DoFile(l, preloadPath)
if err != nil { if err2 != nil {
fmt.Fprintln(os.Stderr, "Missing nature module, some functionality and builtins will be missing.") fmt.Fprintln(os.Stderr, "Missing nature module, some functionality and builtins will be missing.")
fmt.Fprintln(os.Stderr, "local error:", err1)
fmt.Fprintln(os.Stderr, "global install error:", err2)
} }
} }
} }