lua-users home
lua-l archive

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


From what I know and have seen when this was explored heavily in the node ecosystem there are three main techniques to making a version manager.

1. Use global symlinks. Pros:  Simple, no mucking with environments, and all programs can see the change.  Cons: All programs will see the change.
2. Spawn a subshell with environment variables set. Pros: No messing with teaching people how to source bash scripts. Cons: Yet another shell and process.  What happens if you change multiple times, does it keep getting deeper?
3. Write a bash function. Pros: Edits environment in-place for the current shell. Cons: Installing can be tricky as most people don't know the difference between sourcing and running a script.

In the early node days we had a champion of all three methods.  My nvm was the source a bash function style.  Isaac made the subshell option with nave and TJ Holowaychuk made n which went the symlink route.  As far as I can tell, nvm is the only one that's used heavily anymore and pretty much every node getting started guide tells people to install nvm.

When I made it the instructions were to clone this repo somewhere and add a line to your bash profile to source a script in it.  Nowadays people just use the contributed installer script which tries to do all this automatically.

Popularity doesn't mean a technique is better or best, but I hope my experience can be at least helpful.  If you do go with a nvm style path, be sure to read up on how the install instructions are worded and look at past issues where people were confused.

https://github.com/creationix/nvm
https://github.com/tj/n
https://github.com/isaacs/nave

-Tim

On Thu, May 26, 2016 at 5:27 PM, Coda Highland <chighland@gmail.com> wrote:
On Thu, May 26, 2016 at 2:09 PM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Andrew Starks once stated:
>> On Thu, May 26, 2016 at 15:31 Dhaval Kapil <me@dhavalkapil.com> wrote:
>>
>> > PS: I'm still confused on what to name it :P
>>
>> whatlua
>> thatlua
>> thislua
>> ntltl - not that Lua this Lua.
>> luahood
>> luacrib
>
>   lua123
>   whichlua
>   uselua
>   alualua
>
>   -spc
>
>

+1 to "uselua" -- it reads perfectly on the command line: "uselua 5.1
script.lua".

/s/ Adam