Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mah0x211/lenv
Lua Version Manager
https://github.com/mah0x211/lenv
Last synced: 26 days ago
JSON representation
Lua Version Manager
- Host: GitHub
- URL: https://github.com/mah0x211/lenv
- Owner: mah0x211
- License: mit
- Created: 2015-05-09T12:58:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T05:49:50.000Z (8 months ago)
- Last Synced: 2024-08-03T16:08:53.672Z (4 months ago)
- Language: Go
- Homepage:
- Size: 87.9 KB
- Stars: 43
- Watchers: 7
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-version-managers - lenv - A Lua version manager that allows installation and switching between multiple versions. (Version Managers / Lua)
README
lenv
=========[![test](https://github.com/mah0x211/lenv/actions/workflows/test.yml/badge.svg)](https://github.com/mah0x211/lenv/actions/workflows/test.yml)
Lua Version Manager.
---
## Installation
1. download a binary release from the [releases](https://github.com/mah0x211/lenv/releases) page.
2. extract the downloaded file and place the `lenv` command in the desired location. (e.g. `/usr/local/bin/lenv`)
3. run a `lenv setup` command to set up the required files and directories.
- you can also run a `lenv -g setup` command to set up the required files and directories in the `/usr/local/lenv` directory.**Setting up the `.lenvrc` file.**
1. run `lenv path > ~/.lenvrc` command to create the `lenvrc` file.
- if you set up the required files and directories in the `/usr/local/lenv` directory, you should run a `lenv -g path > ~/.lenvrc` command.
2. add the following to your `.bashrc` or `.bash_profile` file.
```sh
source ~/.lenvrc
```## Commands
please run a `help` command to show the help message.
```
$ lenv helplenv - lua version manager
Usage:
lenv [...]Options:
-g, --global Use /usr/local/lenv as installation directoryCommands:
help Show this message
setup Set up required files and directories
path [] Show the configured pathsNote:
The specifier of the above commands can be specified as follows;lenv path bin ; show the PATH of the current lua environment
lenv path lualib ; show the LUA_PATH of the current lua environment
lenv path luaclib ; show the LUA_CPATH of the current lua environmentif is not specified, all the above paths of the current lua
environment will be shown.fetch Fetch remote versions
vers List available versions
ls List installed versions
install Install and use a of lua
use Use a of lua
uninstall Uninstall a of luaNote:
The specifier of the above commands can be specified as follows;lenv install latest ; that picks the latest version
lenv install 5 ; that picks the latest minor version and patch version
lenv install 5.4 ; that picks the latest patch version
lenv install lj-v2.1 ; that picks the version of luajitlenv install latest:latest ; that picks the the latest version of lua and
; luarocks in current lua environment
lenv install :latest ; that picks the the latest version of luarocks
in current lua environmentIf the version of luarocks is specified along with the version of lua, the
operation will target the specified version of the lua environment.
Otherwise, the operation will target the current lua environment.In the case of the 'uninstall' command, the version specifier must match the
target version exactly. Also, if the version of luarocks is specified along
with the version of lua, the version specifier of luarocks is ignored.```
**NOTE: you must run a `fetch` command at the first. that command will crawling the version files of `Lua`, `LuaJIT` and `LuaRocks` immediately.**
```sh
$ lenv fetch
...snip...
$ lenv vers
...snip...
```**Package URL's**
the following URL's are used to download the version files and source files.
- Lua: https://lua.org/ftp/
- LuaJIT: https://github.com/LuaJIT/LuaJIT.git
- LuaRocks: https://luarocks.github.io/luarocks/releases/## Usage
the following example are installing the Lua 5.1.5.
```sh
$ lenv install 5.1.5 macosx
...snip...
$ lua -v
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
```the following example are installing the LuaJIT v2.1.
```sh
$ lenv install lj-v2.1
...snip...
$ lua -v
LuaJIT 2.1.1710088188 -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/
```the following example are installing the LuaRocks 3.5.0 for Lua 5.1.5.
```sh
$ lenv use 5.1.5
use lua version 5.1.5 ("lua/5.1.5")
$ lenv install-rocks 3.5.0
...snip...
$ luarocks --version
/Users/mah/.lenv/current/lua_modules/bin/luarocks 3.5.0
LuaRocks main command-line interface
```the following example are installing the lua and luarocks at same time.
```sh
$ lenv install 5.1.:latest
...snip...
$ lua -v
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
$ luarocks --version
/Users/mah/.lenv/current/lua_modules/bin/luarocks 3.9.2
LuaRocks main command-line interface
```### Installation Locations
lenv manages the following directories.
```
~/.lenv
├── current -> symlink to the `lua/ or `luajit/` directory
├── lua/ -> lua installation directory
│ ├── lua_modules -> symlink to `luarocks//lua_modules`
│ └── luarocks/ -> luarocks installation directory for lua/
│ └── lua_modules
│ ├── bin -> symlink to `luarocks//bin`
│ ├── lualib/ -> symlink to LUA_PATH/LUA_CPATH directories under
│ └── luaclib/ the luarocks/ directory
│
├── luajit/ -> luajit installation directory
│ │
│ :: same layout as the lua/ directory ::
│
└── src
└── .tar.gz
```