diff options
Diffstat (limited to 'src/luarocks/path.lua')
| -rw-r--r-- | src/luarocks/path.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index 3ff0db8a..83b84530 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua | |||
| @@ -6,6 +6,7 @@ module("luarocks.path", package.seeall) | |||
| 6 | 6 | ||
| 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 | 10 | ||
| 10 | help_summary = "Return the currently configured package path." | 11 | help_summary = "Return the currently configured package path." |
| 11 | help_arguments = "" | 12 | help_arguments = "" |
| @@ -301,14 +302,15 @@ function versioned_name(file, prefix, name, version) | |||
| 301 | end | 302 | end |
| 302 | 303 | ||
| 303 | --- Driver function for "path" command. | 304 | --- Driver function for "path" command. |
| 305 | -- This platform distinction is not in fs to avoid depending on that module here. | ||
| 304 | -- @return boolean This function always succeeds. | 306 | -- @return boolean This function always succeeds. |
| 305 | function run(...) | 307 | function run(...) |
| 306 | if cfg.is_platform("unix") then | 308 | if cfg.is_platform("unix") then |
| 307 | print("export LUA_PATH='"..package.path.."'") | 309 | util.printout("export LUA_PATH='"..package.path.."'") |
| 308 | print("export LUA_CPATH='"..package.cpath.."'") | 310 | util.printout("export LUA_CPATH='"..package.cpath.."'") |
| 309 | elseif cfg.is_platform("windows") then | 311 | elseif cfg.is_platform("windows") then |
| 310 | print("SET LUA_PATH="..package.path) | 312 | util.printout("SET LUA_PATH="..package.path) |
| 311 | print("SET LUA_CPATH="..package.cpath) | 313 | util.printout("SET LUA_CPATH="..package.cpath) |
| 312 | end | 314 | end |
| 313 | return true | 315 | return true |
| 314 | end | 316 | end |
