Load Lua-files by relative path

前端 未结 4 1688
故里飘歌
故里飘歌 2020-12-23 11:22

If I have a file structure like this:

./main.lua
./mylib/mylib.lua
./mylib/mylib-utils.lua
./mylib/mylib-helpers.lua
./mylib/mylib-other-stuff.lua

4条回答
  •  礼貌的吻别
    2020-12-23 12:22

    Under the Conky's Lua environment I've managed to include my common.lua (in the same directory) as require(".common"). Note the leading dot . character.

提交回复
热议问题