mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
feat(lua): add utility functions to detect Lua, OS, Python environment, TypeScript environment, Git root, and safe function invocation.
This commit is contained in:
10
lua/absolute/utils/get-git-root.lua
Normal file
10
lua/absolute/utils/get-git-root.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
function GetProjectRoot()
|
||||
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if git_root == nil then
|
||||
return vim.fn.getcwd()
|
||||
else
|
||||
return git_root
|
||||
end
|
||||
end
|
||||
|
||||
return GetProjectRoot
|
||||
Reference in New Issue
Block a user