aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/fetch.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua
index c5983797..3f96e523 100644
--- a/src/luarocks/fetch.lua
+++ b/src/luarocks/fetch.lua
@@ -59,7 +59,11 @@ function fetch_url_at_temp_dir(url, tmpname, filename)
59 59
60 local protocol, pathname = dir.split_url(url) 60 local protocol, pathname = dir.split_url(url)
61 if protocol == "file" then 61 if protocol == "file" then
62 return pathname, dir.dir_name(fs.absolute_name(pathname)) 62 if fs.exists(pathname) then
63 return pathname, dir.dir_name(fs.absolute_name(pathname))
64 else
65 return nil, "File not found: "..pathname
66 end
63 else 67 else
64 local temp_dir = fs.make_temp_dir(tmpname) 68 local temp_dir = fs.make_temp_dir(tmpname)
65 if not temp_dir then 69 if not temp_dir then