From d453f54d98536eb3a52daebfe279c4e624979c31 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Mon, 18 Mar 2024 02:50:16 +0300 Subject: fix: search build directories now depends on config.build_dir --- lua/cmake-explorer/project.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lua/cmake-explorer/project.lua') diff --git a/lua/cmake-explorer/project.lua b/lua/cmake-explorer/project.lua index bdd54e3..7006656 100644 --- a/lua/cmake-explorer/project.lua +++ b/lua/cmake-explorer/project.lua @@ -36,7 +36,13 @@ function Project:new(o) end function Project:scan_build_dirs() - local candidates = Scandir.scan_dir(self.path, { hidden = false, only_dirs = true, depth = 0, silent = true }) + local builds_root = utils.is_eq( + Path:new(config.build_dir):absolute(), + true, + config.build_dir, + Path:new(self.path, config.build_dir):absolute() + ) + local candidates = Scandir.scan_dir(builds_root, { hidden = false, only_dirs = true, depth = 0, silent = true }) for _, v in ipairs(candidates) do local fa = FileApi:new(v) if fa and fa:exists() and fa:read_reply() then -- cgit v1.2.3