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 Aug 3, 2024
1 parent 72a1e37 commit 83d048d
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 83d048d

Please sign in to comment.