diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-05-13 19:16:24 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-05-13 19:22:15 -0300 |
commit | 86667c1ca3b5248404c2a150f7ed1ce93f545cf2 (patch) | |
tree | 4c8de581181f390425299b694c88ba8a6a7f0f00 | |
parent | 6b5e834242bec8e00256a7c6e639395086d558b5 (diff) | |
download | luarocks-86667c1ca3b5248404c2a150f7ed1ce93f545cf2.tar.gz luarocks-86667c1ca3b5248404c2a150f7ed1ce93f545cf2.tar.bz2 luarocks-86667c1ca3b5248404c2a150f7ed1ce93f545cf2.zip |
install.bat: always set LUA_DIR if Lua install is found
Closes #1671.
-rw-r--r-- | install.bat | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/install.bat b/install.bat index b957299f..016eddaf 100644 --- a/install.bat +++ b/install.bat | |||
@@ -634,6 +634,14 @@ local function get_possible_lua_directories() | |||
634 | return directories | 634 | return directories |
635 | end | 635 | end |
636 | 636 | ||
637 | local function strip_bin(bindir) | ||
638 | bindir = bindir:gsub("[/\\]*$", "") | ||
639 | if bindir:upper():match("[/\\]BIN") then | ||
640 | bindir = bindir:sub(1, -5):gsub("[/\\]*$", "") | ||
641 | end | ||
642 | return bindir | ||
643 | end | ||
644 | |||
637 | local function look_for_lua_install () | 645 | local function look_for_lua_install () |
638 | print("Looking for Lua interpreter") | 646 | print("Looking for Lua interpreter") |
639 | if vars.LUA_BINDIR and vars.LUA_LIBDIR and vars.LUA_INCDIR then | 647 | if vars.LUA_BINDIR and vars.LUA_LIBDIR and vars.LUA_INCDIR then |
@@ -643,6 +651,7 @@ local function look_for_lua_install () | |||
643 | then | 651 | then |
644 | if get_runtime() then | 652 | if get_runtime() then |
645 | print("Runtime check completed.") | 653 | print("Runtime check completed.") |
654 | vars.LUA_DIR = vars.LUA_PREFIX or strip_bin(vars.LUA_BINDIR) | ||
646 | return true | 655 | return true |
647 | end | 656 | end |
648 | end | 657 | end |