diff --git a/config/nvim/init.lua b/config/nvim/init.lua index d784285..265b7e0 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -4,8 +4,13 @@ require "os" function gitTopLevelDirectory() local handle = io.popen("git rev-parse --show-toplevel") + if handle == nil then + return nil + end + local gitRepoTopLevelDirectoryPath = vim.fn.trim(handle:read("*a")) handle:close() + return gitRepoTopLevelDirectoryPath end