diff options
Diffstat (limited to 'src/luarocks/path.lua')
-rw-r--r-- | src/luarocks/path.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index d7273095..200829d0 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua | |||
@@ -7,7 +7,6 @@ module("luarocks.path", package.seeall) | |||
7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
8 | local cfg = require("luarocks.cfg") | 8 | local cfg = require("luarocks.cfg") |
9 | local util = require("luarocks.util") | 9 | local util = require("luarocks.util") |
10 | local deps = require("luarocks.deps") | ||
11 | 10 | ||
12 | help_summary = "Return the currently configured package path." | 11 | help_summary = "Return the currently configured package path." |
13 | help_arguments = "" | 12 | help_arguments = "" |
@@ -390,42 +389,3 @@ function which(module_name, filename, name, version, tree, manifest) | |||
390 | assert(false) | 389 | assert(false) |
391 | end | 390 | end |
392 | 391 | ||
393 | --- Driver function for "path" command. | ||
394 | -- @return boolean This function always succeeds. | ||
395 | function run(...) | ||
396 | local flags = util.parse_flags(...) | ||
397 | local deps_mode = deps.get_deps_mode(flags) | ||
398 | |||
399 | local lr_path, lr_cpath = cfg.package_paths() | ||
400 | local bin_dirs = map_trees(deps_mode, deploy_bin_dir) | ||
401 | |||
402 | if flags["lr-path"] then | ||
403 | util.printout(util.remove_path_dupes(lr_path, ';')) | ||
404 | return true | ||
405 | elseif flags["lr-cpath"] then | ||
406 | util.printout(util.remove_path_dupes(lr_cpath, ';')) | ||
407 | return true | ||
408 | elseif flags["lr-bin"] then | ||
409 | local lr_bin = util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator) | ||
410 | util.printout(util.remove_path_dupes(lr_bin, ';')) | ||
411 | return true | ||
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 | ||
421 | |||
422 | util.printout(cfg.export_lua_path:format(util.remove_path_dupes(lr_path, ';'))) | ||
423 | util.printout(cfg.export_lua_cpath:format(util.remove_path_dupes(lr_cpath, ';'))) | ||
424 | if flags["bin"] then | ||
425 | table.insert(bin_dirs, 1, os.getenv("PATH")) | ||
426 | local lr_bin = util.remove_path_dupes(table.concat(bin_dirs, cfg.export_path_separator), cfg.export_path_separator) | ||
427 | util.printout(cfg.export_path:format(lr_bin)) | ||
428 | end | ||
429 | return true | ||
430 | end | ||
431 | |||