MunifTanjim / luver

Version manager for Lua, built with :heart:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

luver

Version manager for Lua, built with ❤️

Luver supports:

Installation

Requirements:

  • Bash v4 or newer (MacOS ships with older version by default).

Git Clone

export LUVER_DIR="${HOME}/.local/share/luver"
mkdir -p "${LUVER_DIR}"
git clone https://github.com/MunifTanjim/luver.git "${LUVER_DIR}/self"

Bash

Manual Installation

After doing Git Clone, source the entrypoint:

source "${LUVER_DIR}/self/luver.bash"

or just put this in your .bashrc file:

export LUVER_DIR="${LUVER_DIR:-"${XDG_DATA_HOME:-"${HOME}/.local/share"}/luver"}"

if [[ ! -d "${LUVER_DIR}/self" ]]; then
  git clone --quiet https://github.com/MunifTanjim/luver.git "${LUVER_DIR}/self"
fi

source "${LUVER_DIR}/self/luver.bash"

Shell Completion

luver comes with shell completion script for Bash.

Make sure you have "bash-completion" package installed on your system.

To generate the shell completion script and store it, run:

luver completion bash | tee "${XDG_DATA_HOME:-"${HOME}/.local/share"}/bash-completion/completions/luver"

Fish

Using Plugin Manger (recommended)

Using fisher:

fisher install MunifTanjim/luver

Shell Completion

luver comes with shell completion script for Fish.

If you installed it using fisher, you don't need to do anything else.

To generate the shell completion script and store it, run:

luver completion fish | tee $__fish_config_dir/completions/luver.fish

Zsh

Using Plugin Manager (recommended)

Using zed:

zed load github.com/MunifTanjim/luver

Manual Installation

After doing Git Clone, source the entrypoint:

source "${LUVER_DIR}/self/luver.plugin.zsh"

or just put this in your .zshrc file:

export LUVER_DIR="${LUVER_DIR:-"${XDG_DATA_HOME:-"${HOME}/.local/share"}/luver"}"

if [[ ! -d "${LUVER_DIR}/self" ]]; then
  git clone --quiet https://github.com/MunifTanjim/luver.git "${LUVER_DIR}/self"
fi

source "${LUVER_DIR}/self/luver.plugin.zsh"

Shell Completion

luver comes with shell completion script for Zsh.

To generate the shell completion script _luver, run:

luver completion zsh > _luver

Then store the _luver file in one of the directories present in $fpath variable:

# print the list of fpath directories
echo ${(j.\n.)fpath}

Command Usage

Run luver help to get started.

Lua

Install a Lua version:

luver install lua 5.1.5

Create a Lua version alias:

luver alias 5.4.3 latest
# default version
luver alias 5.1.5 default

Lua version set to default alias is used automatically when you open a new shell.

Use a specific Lua version (or alias):

# version
luver use 5.3.6

# alias
luver use latest

Get currently used Lua version:

luver current lua

List currently installed Lua versions:

luver list lua

Uninstall a Lua version:

luver uninstall lua 5.3.6

LuaJIT

If your currently used Lua is at least v5, you can install LuaJIT alongside it:

# released version
luver install luajit 2.0.5

# latest git version
luver install luajit 2.1.0-git

The other commands are similar to Lua.

LuaRocks

You can install LuaRocks for you currently used Lua version:

luver install luarocks 3.8.0

The other commands are similar to Lua.

GitHub Action

You can also use Luver in GitHub Actions workflow!

Check: MunifTanjim/luver-action

License

Licensed under the MIT License. Check the LICENSE file for details.

About

Version manager for Lua, built with :heart:

License:MIT License


Languages

Language:Shell 100.0%