Skip to content

Latest commit

 

History

History
99 lines (66 loc) · 2.59 KB

File metadata and controls

99 lines (66 loc) · 2.59 KB

logo

E2E tests

vfox-lua plugin

Lua vfox plugin. Use the vfox to manage multiple lua versions on Linux, macOS, and Windows.

Requirements

  • macOS / Linux
    • GNU Make
    • ANSI C compiler (gcc or clang)
    • readline development library (libreadline-dev on Debian/Ubuntu, readline via Homebrew on macOS)
  • Windows (install via MSYS2)
    • GCC compiler
    • Make

Usage

Install with vfox

# install plugin
vfox add --source https://github.com/yeshan333/vfox-lua/archive/refs/heads/main.zip lua

# search available versions
vfox search lua

# install a specific version
vfox install lua@5.4.7

# activate
vfox use -g lua@5.4.7

Install with mise

The vfox-lua plugin can also be used through mise, which supports vfox plugins as a backend.

# install and activate
mise use -g vfox:yeshan333/lua@5.4.7

# run lua
mise exec -- lua -v

LuaRocks Integration

LuaRocks can be automatically installed alongside Lua by setting the VFOX_LUA_LUAROCKS environment variable. This is supported on Linux and macOS only.

# vfox
VFOX_LUA_LUAROCKS=1 vfox install lua@5.4.7

# mise
VFOX_LUA_LUAROCKS=1 mise use -g vfox:yeshan333/lua@5.4.7

When enabled, the plugin will:

  1. Fetch the latest LuaRocks release from GitHub (fallback: 3.11.1)
  2. Build and bootstrap LuaRocks into <install-dir>/luarocks/
  3. Add luarocks to PATH and configure LUA_INIT so that installed rocks are immediately available
# verify
luarocks --version

# install a rock
luarocks install luacheck

Notice

  1. Make sure build tools (gcc/clang, make) are in your system $PATH.

  2. Lua 5.4+ on Linux/macOS is compiled with readline by default. Install the readline development library before building:

    • Debian/Ubuntu: sudo apt-get install libreadline-dev
    • macOS: brew install readline
  3. On Windows, use PowerShell to install Lua.

Known Issues

  • Lua versions 5.0 and earlier cannot be installed on Linux.
  • LuaRocks integration is not available on Windows.

Acknowledgements