Update c.lua
This commit is contained in:
+4
-1
@@ -293,6 +293,7 @@ function M.run()
|
||||
|
||||
local build_dir = project_root .. "/build"
|
||||
local files = vim.fn.glob(build_dir .. "/*.txt", true, true)
|
||||
|
||||
local project_name = nil
|
||||
for _, file in ipairs(files) do
|
||||
if vim.fn.match(file, "CMakeCache.txt") == -1 then
|
||||
@@ -306,7 +307,9 @@ function M.run()
|
||||
return
|
||||
end
|
||||
|
||||
M.open_float_terminal("cd " .. build_dir .. " && ." .. project_name)
|
||||
-- Ensure the project_name is being used correctly in the command
|
||||
local executable_path = build_dir .. "/" .. project_name
|
||||
M.open_float_terminal("cd " .. build_dir .. " && ./" .. project_name)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user