lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If you're building an application where someone will execute it in the same directory as the code is then it's less of an issue to hard-code the adjustments to package.path. I'll amend the post. Only when building a module should you not include modified package.path in your code.

On Thu, Jan 28, 2016 at 12:54 PM, John Gabriele <jgabriele@fastmail.fm> wrote:
Excellent! Very nice article. Thanks, Leaf!
 
Incidentally, for utilizing modules installed into my own app's my-app/lua_modules dir, why wouldn't I instead simply modify package.path and package.cpath right in my program before `require`ing the libs? (With the idea being that I'd distribute my entire my-app directory to whomever is going to be running it.)
 
-- John
 
 
 
On Thu, Jan 28, 2016, at 03:05 PM, leaf corcoran wrote:
Hello list,
 
I've been talking to a few people about what needs to be done encourage use of LuaRocks in more places within the Lua community. A common request is "I wish LuaRocks installed packages in the current directory like npm." It bums me out to hear that because it's definitely already possible, but non-explicit documentation hides the feature.
 
I wrote a guide explaining about how LuaRocks installs packages, and how you can use it to install packages to the local directory:
 
 
Feedback appreciated. I also plan to write a few more guides specific to certain environments (eg. using with OpenResty, LÖVE).
 
Thanks for checking it out