diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-05-31 14:12:43 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-05-31 14:31:25 -0300 |
commit | 494a4934633ff81368090a3265abb02d03f5d9e5 (patch) | |
tree | 520a78afbae84227cc141b230000a7868dd6d563 | |
parent | 1e0c7eb2093151f316280bc6f5b703c2d6ddb91c (diff) | |
download | luarocks-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.lua | 6 |
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. |
3 | local install = {} | 3 | local install = {} |
4 | 4 | ||
5 | local dir = require("luarocks.dir") | ||
5 | local path = require("luarocks.path") | 6 | local path = require("luarocks.path") |
6 | local repos = require("luarocks.repos") | 7 | local repos = require("luarocks.repos") |
7 | local fetch = require("luarocks.fetch") | 8 | local 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 | ||