diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/fs/tools.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/luarocks/fs/tools.lua b/src/luarocks/fs/tools.lua index 5c317f65..ff29ea39 100644 --- a/src/luarocks/fs/tools.lua +++ b/src/luarocks/fs/tools.lua | |||
| @@ -64,7 +64,7 @@ do | |||
| 64 | for _, directory in ipairs(dir_stack) do | 64 | for _, directory in ipairs(dir_stack) do |
| 65 | current = fs.absolute_name(directory, current) | 65 | current = fs.absolute_name(directory, current) |
| 66 | end | 66 | end |
| 67 | return current | 67 | return current, cache_pwd |
| 68 | end | 68 | end |
| 69 | end | 69 | end |
| 70 | 70 | ||
| @@ -107,9 +107,11 @@ end | |||
| 107 | -- @return boolean: true if command succeeds (status code 0), false | 107 | -- @return boolean: true if command succeeds (status code 0), false |
| 108 | -- otherwise. | 108 | -- otherwise. |
| 109 | function tools.execute_string(cmd) | 109 | function tools.execute_string(cmd) |
| 110 | local current = fs.current_dir() | 110 | local current, cache_pwd = fs.current_dir() |
| 111 | if not current then return false end | 111 | if not current then return false end |
| 112 | cmd = fs.command_at(current, cmd) | 112 | if current ~= cache_pwd then |
| 113 | cmd = fs.command_at(current, cmd) | ||
| 114 | end | ||
| 113 | local code = os.execute(cmd) | 115 | local code = os.execute(cmd) |
| 114 | if code == 0 or code == true then | 116 | if code == 0 or code == true then |
| 115 | return true | 117 | return true |
