From 77aeb472360449396f1a64d83f8c0b6f27660058 Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Mon, 10 Mar 2025 14:21:53 -0400 Subject: [PATCH] Update c.lua --- lua/Polydev/c.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/Polydev/c.lua b/lua/Polydev/c.lua index aef64a3..0dc55fb 100644 --- a/lua/Polydev/c.lua +++ b/lua/Polydev/c.lua @@ -283,6 +283,15 @@ function M.build() end function M.run() + -- Get the current file's directory + local current_dir = vim.fn.expand("%:p:h") + -- Try to find the root of the project by matching the path + local project_root = current_dir:match("(.*)/src") + if not project_root then + print("Error: src directory not found.") + return + end + -- Define the build directory local build_dir = project_root .. "/build"