Search code examples
linuxluazerobrane

how to set the LUA_PATH and LUA_CPATH for the zerobrane studio in linux


I want to add a module path for all of my project in zerobrane. I add following code into the user.lua.

LUA_PATH=LUA_PATH .. ';mypath'  or
package.path=package.path .. ';mypath'

It can't work. how can I do it ?

PS
I don't want to set the package.path at the begin of all the project.


Solution

  • I add following method into the /opt/zbsstudio/lualibs/mobdebug/mobdebug.lua file.

    package.path = package.path .. ';my_path/?/init.lua'
    package.cpath = package.cpath .. ';my_path/?.so'
    

    But I'm not sure that's the best way.