Skip to content

Commit

Permalink
chore(test): fix fs test
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvirtin committed Jul 16, 2024
1 parent 3a6d87b commit 54a9833
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lua/vgit/core/fs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ function fs.filetype(buffer)
end

function fs.read_file(filepath)
local lines = vim.fn.readfile(filepath)
if not lines then return nil, { 'file not found' } end
return lines
if not fs.exists(filepath) then return nil, { 'file not found' } end
return vim.fn.readfile(filepath)
end

function fs.write_file(filepath, lines)
Expand Down

0 comments on commit 54a9833

Please sign in to comment.