diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-20 14:18:00 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 15:51:13 -0300 |
commit | 744df0e5bf1ed712478c3df6aa28901f38d7189f (patch) | |
tree | 7dd31e8f98d709673fa180593fd2a2ef38071135 | |
parent | 0bab439d4b8f3d4c62340f7e0f6accca3355b30a (diff) | |
download | luarocks-744df0e5bf1ed712478c3df6aa28901f38d7189f.tar.gz luarocks-744df0e5bf1ed712478c3df6aa28901f38d7189f.tar.bz2 luarocks-744df0e5bf1ed712478c3df6aa28901f38d7189f.zip |
Tests: ensure that tests do not accidentally find a project dir
-rw-r--r-- | spec/util/test_env.lua | 1 | ||||
-rw-r--r-- | src/luarocks/cmd.lua | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 1d4e98d8..269a1cfc 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -839,6 +839,7 @@ function test_env.main() | |||
839 | end | 839 | end |
840 | 840 | ||
841 | lfs.mkdir(testing_paths.testrun_dir) | 841 | lfs.mkdir(testing_paths.testrun_dir) |
842 | test_env.write_file(testing_paths.testrun_dir .. "/.luarocks-no-project", "") | ||
842 | lfs.mkdir(testing_paths.testing_cache) | 843 | lfs.mkdir(testing_paths.testing_cache) |
843 | lfs.mkdir(testing_paths.luarocks_tmp) | 844 | lfs.mkdir(testing_paths.luarocks_tmp) |
844 | 845 | ||
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 70d93670..6ce9a8b5 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -175,6 +175,8 @@ do | |||
175 | if fs.is_dir(abs .. "/.luarocks") and fs.is_dir(abs .. "/lua_modules") then | 175 | if fs.is_dir(abs .. "/.luarocks") and fs.is_dir(abs .. "/lua_modules") then |
176 | abs = abs:gsub("/.$", "") | 176 | abs = abs:gsub("/.$", "") |
177 | return abs, abs .. "/lua_modules" | 177 | return abs, abs .. "/lua_modules" |
178 | elseif fs.exists(abs .. "/.luarocks-no-project") then | ||
179 | return nil | ||
178 | end | 180 | end |
179 | try = try .. "/.." | 181 | try = try .. "/.." |
180 | end | 182 | end |