Skip to content

Commit 9f1c58b

Browse files
committed
fix(scanner):Move initial scan for kits to setup
1 parent 12d1018 commit 9f1c58b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lua/cmake-tools/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ function cmake.setup(values)
6666
cmake.register_autocmd()
6767
cmake.register_autocmd_provided_by_users()
6868
cmake.register_scratch_buffer(config.executor.name, config.runner.name)
69+
if not vim.uv.fs_stat(const.cmake_kits_path) then
70+
scanner.scan_for_kits()
71+
end
6972
end
7073

7174
---@param callback fun(result: cmake.Result)
@@ -215,10 +218,7 @@ function cmake.generate(opt, callback)
215218

216219
-- if exists cmake-kits.json, kit is used to set
217220
-- environmental variables and args.
218-
local kits_config = kits.parse(const.cmake_kits_path, config.cwd)
219-
if not kits_config then
220-
kits_config = scanner.scan_for_kits()
221-
end
221+
local kits_config = kits.parse(const.cmake_config_path, config.cwd)
222222
if kits_config and not config.kit then
223223
return cmake.select_kit(function(result)
224224
if not result:is_ok() then

0 commit comments

Comments
 (0)