From 2a3eb136ec3542a70dab3cca1d432d8228cb29b1 Mon Sep 17 00:00:00 2001 From: Xpol Wan Date: Mon, 11 Jul 2016 12:47:46 +0800 Subject: Make package.path and package.cpath unique in win32 bin scripts. --- src/luarocks/cfg.lua | 2 +- src/luarocks/fs/win32.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 9b1c5902..d58c7407 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -403,7 +403,7 @@ local defaults = { if cfg.platforms.windows then local full_prefix = (site_config.LUAROCKS_PREFIX or (os.getenv("PROGRAMFILES")..[[\LuaRocks]])) - extra_luarocks_module_dir = full_prefix.."\\lua\\?.lua" + extra_luarocks_module_dir = full_prefix.."/lua/?.lua" home_config_file = home_config_file and home_config_file:gsub("\\","/") defaults.fs_use_modules = false diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua index 8debaeef..c99cc895 100644 --- a/src/luarocks/fs/win32.lua +++ b/src/luarocks/fs/win32.lua @@ -130,6 +130,8 @@ function win32.wrap_script(file, dest, name, version) local wrapname = fs.is_dir(dest) and dest.."/"..base or dest wrapname = wrapname..".bat" local lpath, lcpath = cfg.package_paths() + lpath = util.remove_path_dupes(lpath, ";") + lcpath = util.remove_path_dupes(lcpath, ";") local wrapper = io.open(wrapname, "w") if not wrapper then return nil, "Could not open "..wrapname.." for writing." -- cgit v1.2.3-55-g6feb