diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-04-13 20:22:57 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-04-13 20:22:57 -0300 |
commit | 0679559812674fdd9b0a9c17852ebd03f7ff2fc4 (patch) | |
tree | c0df40a9a027fac1ebd4b539abf1aa934c20e3b1 | |
parent | 40f9173755e9c770a6f773bc2bf00bc13fd8bec0 (diff) | |
download | luarocks-0679559812674fdd9b0a9c17852ebd03f7ff2fc4.tar.gz luarocks-0679559812674fdd9b0a9c17852ebd03f7ff2fc4.tar.bz2 luarocks-0679559812674fdd9b0a9c17852ebd03f7ff2fc4.zip |
Decided to step back in turn this into a warning.
`luarocks list` on an empty ~/.luarocks is a valid use case.
-rw-r--r-- | src/luarocks/list.lua | 4 | ||||
-rw-r--r-- | test/testing.lua | 2 | ||||
-rwxr-xr-x | test/testing.sh | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/luarocks/list.lua b/src/luarocks/list.lua index 22dbb721..518b83ce 100644 --- a/src/luarocks/list.lua +++ b/src/luarocks/list.lua | |||
@@ -93,9 +93,9 @@ function list.run(...) | |||
93 | 93 | ||
94 | local results = {} | 94 | local results = {} |
95 | for _, tree in ipairs(trees) do | 95 | for _, tree in ipairs(trees) do |
96 | local ok, err, errcode = search.manifest_search(results, path.rocks_dir(tree), query) | 96 | local ok, err = search.manifest_search(results, path.rocks_dir(tree), query) |
97 | if not ok then | 97 | if not ok then |
98 | return nil, err | 98 | util.warning(err) |
99 | end | 99 | end |
100 | end | 100 | end |
101 | util.title("Installed rocks:", flags["porcelain"]) | 101 | util.title("Installed rocks:", flags["porcelain"]) |
diff --git a/test/testing.lua b/test/testing.lua index 8d8b3af2..376d6e9a 100644 --- a/test/testing.lua +++ b/test/testing.lua | |||
@@ -112,7 +112,7 @@ local tests = { | |||
112 | fail_lint_invalid = function() return run "$luarocks lint invalid" end, | 112 | fail_lint_invalid = function() return run "$luarocks lint invalid" end, |
113 | fail_show_invalid = function() return run "$luarocks show invalid" end, | 113 | fail_show_invalid = function() return run "$luarocks show invalid" end, |
114 | fail_new_version_invalid = function() return run "$luarocks new_version invalid" end, | 114 | fail_new_version_invalid = function() return run "$luarocks new_version invalid" end, |
115 | fail_list_invalidtree = function() return run "$luarocks --tree=/some/invalid/tree list" end, | 115 | test_list_invalidtree = function() return run "$luarocks --tree=/some/invalid/tree list" end, |
116 | fail_inexistent_dir = function() | 116 | fail_inexistent_dir = function() |
117 | -- Unix only? | 117 | -- Unix only? |
118 | return run "mkdir idontexist; cd idontexist; rmdir ../idontexist; $luarocks; err=$?; cd ..; return $err" | 118 | return run "mkdir idontexist; cd idontexist; rmdir ../idontexist; $luarocks; err=$?; cd ..; return $err" |
diff --git a/test/testing.sh b/test/testing.sh index af2ec45e..b75b51d7 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -367,7 +367,7 @@ fail_lint_invalid() { $luarocks lint invalid; } | |||
367 | fail_show_invalid() { $luarocks show invalid; } | 367 | fail_show_invalid() { $luarocks show invalid; } |
368 | fail_new_version_invalid() { $luarocks new_version invalid; } | 368 | fail_new_version_invalid() { $luarocks new_version invalid; } |
369 | 369 | ||
370 | fail_list_invalidtree() { $luarocks --tree=/some/invalid/tree list; } | 370 | test_list_invalidtree() { $luarocks --tree=/some/invalid/tree list; } |
371 | 371 | ||
372 | fail_inexistent_dir() { mkdir idontexist; cd idontexist; rmdir ../idontexist; $luarocks; err=$?; cd ..; return $err; } | 372 | fail_inexistent_dir() { mkdir idontexist; cd idontexist; rmdir ../idontexist; $luarocks; err=$?; cd ..; return $err; } |
373 | 373 | ||