Lua Version Manager - luaver
luaver helps to manage and switch between different versions of Lua, LuaJIT and Luarocks.
Features
- Installs/Uninstalls any version of Lua, LuaJIT or luarocks with a single command.
- Switches between different versions of 'Lua', 'LuaJIT' or 'Luarocks' easily, without glitches.
- Consistency between 'Lua' and 'Luarocks' maintained - Rocks and configurations for different lua versions are stored differently.
- Every terminal session can have a different environment configured. Default versions can also be configured.
Requirements
Requires wget
, make
.
You may need to install some dependencies:
sudo apt-get install libreadline-dev
Also, if you are planning to install older versions of Lua(which are 32-bit) on 64-bit machines, you may need to install some 32-bit libraries:
sudo apt-get install lib32ncurses5-dev
Installation
Install script
You can install from the script directly:
curl https://raw.githubusercontent.com/dhavalkapil/luaver/v1.0.0/install.sh -o install.sh && . ./install.sh
Note: It will overwrite any install.sh
in your current directory. Also, this file is no longer needed after the installation is complete.
Installation from Git Repository
First clone luaver
on your local machine using git:
git clone https://github.com/DhavalKapil/luaver
Then, run the installation script:
cd luaver
. ./install.sh
Usage
Sample usage:
luaver install 5.3.1 # Installs Lua version 5.3.1
luaver install 5.3.0 # Installs Lua version 5.3.0
luaver use 5.3.1 # Switches to Lua version 5.3.1
luaver install-luarocks 2.3.0 # Installs Luarocks version 2.3.0
luaver uninstall 5.3.0 # Uninstalls Lua version 5.3.0
Complete usage:
luaver help
Usage:
luaver help Displays this message
luaver install <version> Installs lua-<version>
luaver use <version> Switches to lua-<version>
luaver set-default <version> Sets <version> as default for lua
luaver unset-default Unsets the default lua version
luaver uninstall <version> Uninstalls lua-<version>
luaver list Lists installed lua versions
luaver install-luajit <version> Installs luajit-<version>
luaver use-luajit <version> Switches to luajit-<version>
luaver set-default-luajit <version> Sets <version> as default for luajit
luaver unset-default-luajit Unsets the default luajit version
luaver uninstall-luajit <version> Uninstalls luajit-<version>
luaver list-luajit Lists installed luajit versions
luaver install-luarocks <version> Installs luarocks<version>
luaver use-luarocks <version> Switches to luarocks-<version>
luaver set-default-luarocks <version> Sets <version> as default for luarocks
luaver unset-default-luarocks Unsets the default luarocks version
luaver uninstall-luarocks <version> Uninstalls luarocks-<version>
luaver list-luarocks Lists all installed luarocks versions
luaver current Lists present versions being used
luaver version Displays luaver version
Contribution
Feel free to file issues and submit pull requests – contributions are welcome.
License
luaver is licensed under the MIT license.