aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-05-31 14:12:43 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-05-31 14:31:25 -0300
commit494a4934633ff81368090a3265abb02d03f5d9e5 (patch)
tree520a78afbae84227cc141b230000a7868dd6d563
parent1e0c7eb2093151f316280bc6f5b703c2d6ddb91c (diff)
downloadluarocks-494a4934633ff81368090a3265abb02d03f5d9e5.tar.gz
luarocks-494a4934633ff81368090a3265abb02d03f5d9e5.tar.bz2
luarocks-494a4934633ff81368090a3265abb02d03f5d9e5.zip
fix: if current directory contains luarocks.lock, use it
Fixes #1662.
-rw-r--r--src/luarocks/cmd/install.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/luarocks/cmd/install.lua b/src/luarocks/cmd/install.lua
index 9e705d12..05e31fe7 100644
--- a/src/luarocks/cmd/install.lua
+++ b/src/luarocks/cmd/install.lua
@@ -2,6 +2,7 @@
2-- Installs binary rocks. 2-- Installs binary rocks.
3local install = {} 3local install = {}
4 4
5local dir = require("luarocks.dir")
5local path = require("luarocks.path") 6local path = require("luarocks.path")
6local repos = require("luarocks.repos") 7local repos = require("luarocks.repos")
7local fetch = require("luarocks.fetch") 8local fetch = require("luarocks.fetch")
@@ -124,7 +125,10 @@ function install.install_binary_rock(rock_file, opts)
124 end 125 end
125 126
126 if deps_mode ~= "none" then 127 if deps_mode ~= "none" then
127 ok, err, errcode = deps.fulfill_dependencies(rockspec, "dependencies", deps_mode, opts.verify, install_dir) 128 local deplock_dir = fs.exists(dir.path(".", "luarocks.lock"))
129 and "."
130 or install_dir
131 ok, err, errcode = deps.fulfill_dependencies(rockspec, "dependencies", deps_mode, opts.verify, deplock_dir)
128 if err then return nil, err, errcode end 132 if err then return nil, err, errcode end
129 end 133 end
130 134