fix(init): guard read_file_lines against directory paths (#190)

This commit is contained in:
Barrett Ruth 2026-03-13 07:25:55 -04:00 committed by GitHub
parent 925ba5cb8a
commit a1af48833b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 0 deletions

View file

@ -347,6 +347,9 @@ end
---@param path string
---@return string[]?
local function read_file_lines(path)
if vim.fn.isdirectory(path) == 1 then
return nil
end
local f = io.open(path, 'r')
if not f then
return nil