Quantcast
Channel: How to navigate with .lua to a directory above - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by furq for How to navigate with .lua to a directory above

You can (and probably should) do this with require by adding ../?.lua to package.path, like so:package.path = package.path .. ";../?.lua"require "config"See the require and package.path docs for more...

View Article



Answer by Ryan Stein for How to navigate with .lua to a directory above

You're on the right track with dofile. (However, there is noincludefunction in Lua.) As you may have noticed, you can't do this with require:local cfg = require'../config'require typically works from...

View Article

How to navigate with .lua to a directory above

I have something like this./config.lua/client/init.luaHow can I include the config.lua with include() or dofile()?Lg

View Article
Browsing all 3 articles
Browse latest View live




Latest Images