Skip to content

Commit 14fbcfb

Browse files
committed
Make sure package.path and package.cpath include the proper directories.
1 parent f8657e9 commit 14fbcfb

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

bin/exec-env

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
source $(dirname $(dirname $(dirname $0)))/lib/utils.sh
4+
5+
plugin_name="lua"
6+
7+
full_version=$(get_preset_version_for $plugin_name)
8+
9+
short_lua_version=""
10+
11+
if [ "$full_version" != "system" ]; then
12+
IFS='.' read -r -a splitted_version <<< "$full_version"
13+
short_lua_version="${splitted_version[0]}.${splitted_version[1]}"
14+
fi
15+
16+
install_path="$(get_install_path lua version "${full_version}")"
17+
18+
package_path_override="package.path = package.path .. '\
19+
;${install_path}/share/lua/${short_lua_version}/?.lua\
20+
;${install_path}/share/lua/${short_lua_version}/?/init.lua\
21+
;${install_path}/luarocks/share/lua/${short_lua_version}/?.lua\
22+
;${install_path}/luarocks/share/lua/${short_lua_version}/?/init.lua'"
23+
24+
package_cpath_override="package.cpath = package.cpath .. '\
25+
;${install_path}/lib/lua/${short_lua_version}/?.so\
26+
;${install_path}/luarocks/lib/lua/${short_lua_version}/?.so'"
27+
28+
export LUA_INIT="${package_path_override}
29+
${package_cpath_override}"

0 commit comments

Comments
 (0)