Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ fmt:
shfmt --language-dialect bash --indent 2 --write bin/*

lint:
shellcheck --shell bash --external-sources bin/*
shellcheck --shell bash bin/* lib/*

.PHONY: precommit test test_luajit lint
46 changes: 46 additions & 0 deletions bin/help.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\t\n'

version="${ASDF_INSTALL_VERSION:-}"

cat <<'EOF'
Environment Variables:

ASDF_LUA_LUAROCKS_VERSION
Specify the LuaRocks version to install (Lua 5.x only, not LuaJIT).
If not set, the latest version of LuaRocks will be installed.
Example: export ASDF_LUA_LUAROCKS_VERSION=3.9.2
EOF

if [ -n "$version" ]; then
if [[ ! "$version" == LuaJIT-* ]]; then
IFS='.' read -ra version_array <<<"$version"
major_minor="${version_array[0]}${version_array[1]}"

if [ "$major_minor" = "54" ]; then
cat <<'EOF'

ASDF_LUA_LINUX_READLINE
Enable readline support for Lua 5.4.x on Linux.
Readline is optional for Lua 5.4 and disabled by default.
Set to 1 to enable: export ASDF_LUA_LINUX_READLINE=1
EOF
fi
fi
else
cat <<'EOF'

ASDF_LUA_LINUX_READLINE
Enable readline support for Lua 5.4.x on Linux.
Readline is optional for Lua 5.4 and disabled by default.
Set to 1 to enable: export ASDF_LUA_LINUX_READLINE=1

Readline Support by Version:
- Lua 5.1 - 5.3: Readline is required (build fails without libreadline-dev)
- Lua 5.4: Readline is optional and disabled by default
- Lua 5.5+: Readline is loaded dynamically at runtime if available
- LuaJIT: Does not use readline
EOF
fi
36 changes: 36 additions & 0 deletions bin/help.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\t\n'

os="$(uname -s)"

if [ "$os" = "Darwin" ]; then
cat <<EOF
xcode-select
EOF
elif [ "$os" = "Linux" ]; then
if command -v apt-get >/dev/null 2>&1; then
cat <<EOF
build-essential
linux-headers
libreadline-dev
EOF
elif command -v yum >/dev/null 2>&1; then
cat <<EOF
devtoolset-2
readline-devel
EOF
else
cat <<EOF
gcc
make
readline-devel
EOF
fi
else
cat <<EOF
gcc
make
EOF
fi
38 changes: 38 additions & 0 deletions bin/help.links
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\t\n'

version="${ASDF_INSTALL_VERSION:-}"
lua_type="Lua"

if [ -n "$version" ]; then
if [[ "$version" == LuaJIT-* ]]; then
lua_type="LuaJIT"
fi
fi

if [ "$lua_type" = "LuaJIT" ]; then
cat <<EOF
LuaJIT Homepage: https://luajit.org
LuaJIT Repository: https://github.com/LuaJIT/LuaJIT
Download: https://luajit.org/download.html
Documentation: https://luajit.org/luajit.html
Mailing List: https://luajit.org/list.html
EOF
else
cat <<EOF
Lua Homepage: https://www.lua.org
Documentation: https://www.lua.org/docs.html
Reference Manual: https://www.lua.org/manual/5.5/
Getting Started: https://www.lua.org/start.html
Download: https://www.lua.org/download.html
Mailing List: https://www.lua.org/lua-l.html
Community: https://www.lua.org/community.html
EOF
fi

cat <<EOF
Plugin Repository: https://github.com/Stratus3D/asdf-lua
LuaRocks: https://luarocks.org
EOF
23 changes: 23 additions & 0 deletions bin/help.overview
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\t\n'

version="${ASDF_INSTALL_VERSION:-}"
lua_type="Lua"

if [ -n "$version" ]; then
if [[ "$version" == LuaJIT-* ]]; then
lua_type="LuaJIT"
fi
fi

if [ "$lua_type" = "LuaJIT" ]; then
cat <<EOF
LuaJIT is a Just-In-Time Compiler for the Lua programming language. It combines a high-speed interpreter with a state-of-the-art JIT compiler, making it one of the fastest dynamic language implementations. LuaJIT is compatible with Lua 5.1 API and includes the FFI library for calling C functions and manipulating C data structures.
EOF
else
cat <<EOF
Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural, object-oriented, functional, data-driven, and data description programming styles. Lua is dynamically typed, runs by interpreting bytecode with a register-based virtual machine, and has automatic memory management with incremental garbage collection.
EOF
fi
Loading