From de9c9823b9a3e5a0c712bcf23f30d800c18825a4 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 14 Nov 2013 22:21:18 -0200 Subject: Fix `luarocks path` now that luarocks.cfg no longer edits package.path --- src/luarocks/path.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index f8ae15c0..d7273095 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua @@ -410,9 +410,17 @@ function run(...) util.printout(util.remove_path_dupes(lr_bin, ';')) return true end + + if flags["append"] then + lr_path = package.path .. ";" .. lr_path + lr_cpath = package.cpath .. ";" .. lr_cpath + else + lr_path = lr_path.. ";" .. package.path + lr_cpath = lr_cpath .. ";" .. package.cpath + end - util.printout(cfg.export_lua_path:format(util.remove_path_dupes(package.path, ';'))) - util.printout(cfg.export_lua_cpath:format(util.remove_path_dupes(package.cpath, ';'))) + util.printout(cfg.export_lua_path:format(util.remove_path_dupes(lr_path, ';'))) + util.printout(cfg.export_lua_cpath:format(util.remove_path_dupes(lr_cpath, ';'))) if flags["bin"] then table.insert(bin_dirs, 1, os.getenv("PATH")) local lr_bin = util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator) -- cgit v1.2.3-55-g6feb