vim.fn.isdirectory(..) return 0/1

This commit is contained in:
f
2021-11-21 14:09:52 +08:00
parent 940495546f
commit 18d121833b

View File

@@ -165,8 +165,9 @@ local function lazygit(path)
if path == nil then
path = project_root_dir()
end
if path == nil or not fn.isdirectory(path .. '/.git/') then
if path == nil or fn.isdirectory(path .. '/.git/') == 0 then
print('Not in a git repository')
return
end
open_floating_window()
local cmd = 'lazygit'