diff options
-rw-r--r-- | src/luarocks/path.lua | 12 |
1 files 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(...) | |||
410 | util.printout(util.remove_path_dupes(lr_bin, ';')) | 410 | util.printout(util.remove_path_dupes(lr_bin, ';')) |
411 | return true | 411 | return true |
412 | end | 412 | end |
413 | |||
414 | if flags["append"] then | ||
415 | lr_path = package.path .. ";" .. lr_path | ||
416 | lr_cpath = package.cpath .. ";" .. lr_cpath | ||
417 | else | ||
418 | lr_path = lr_path.. ";" .. package.path | ||
419 | lr_cpath = lr_cpath .. ";" .. package.cpath | ||
420 | end | ||
413 | 421 | ||
414 | util.printout(cfg.export_lua_path:format(util.remove_path_dupes(package.path, ';'))) | 422 | util.printout(cfg.export_lua_path:format(util.remove_path_dupes(lr_path, ';'))) |
415 | util.printout(cfg.export_lua_cpath:format(util.remove_path_dupes(package.cpath, ';'))) | 423 | util.printout(cfg.export_lua_cpath:format(util.remove_path_dupes(lr_cpath, ';'))) |
416 | if flags["bin"] then | 424 | if flags["bin"] then |
417 | table.insert(bin_dirs, 1, os.getenv("PATH")) | 425 | table.insert(bin_dirs, 1, os.getenv("PATH")) |
418 | local lr_bin = util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator) | 426 | local lr_bin = util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator) |