aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/path.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/path.lua')
-rw-r--r--src/luarocks/path.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua
index cfe06118..7af81c07 100644
--- a/src/luarocks/path.lua
+++ b/src/luarocks/path.lua
@@ -389,13 +389,28 @@ end
389function run(...) 389function run(...)
390 local flags = util.parse_flags(...) 390 local flags = util.parse_flags(...)
391 local deps_mode = deps.get_deps_mode(flags) 391 local deps_mode = deps.get_deps_mode(flags)
392
393 local lr_path, lr_cpath = cfg.package_paths()
394 local bin_dirs = map_trees(deps_mode, deploy_bin_dir)
395
396 if flags["lr-path"] then
397 util.printout(util.remove_path_dupes(lr_path, ';'))
398 return true
399 elseif flags["lr-cpath"] then
400 util.printout(util.remove_path_dupes(lr_cpath, ';'))
401 return true
402 elseif flags["lr-bin"] then
403 local lr_bin = util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator)
404 util.printout(util.remove_path_dupes(lr_bin, ';'))
405 return true
406 end
392 407
393 util.printout(cfg.export_lua_path:format(util.remove_path_dupes(package.path, ';'))) 408 util.printout(cfg.export_lua_path:format(util.remove_path_dupes(package.path, ';')))
394 util.printout(cfg.export_lua_cpath:format(util.remove_path_dupes(package.cpath, ';'))) 409 util.printout(cfg.export_lua_cpath:format(util.remove_path_dupes(package.cpath, ';')))
395 if flags["bin"] then 410 if flags["bin"] then
396 local bin_dirs = map_trees(deps_mode, deploy_bin_dir)
397 table.insert(bin_dirs, 1, os.getenv("PATH")) 411 table.insert(bin_dirs, 1, os.getenv("PATH"))
398 util.printout(cfg.export_path:format(util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator))) 412 local lr_bin = util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator)
413 util.printout(cfg.export_path:format(lr_bin))
399 end 414 end
400 return true 415 return true
401end 416end