mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
refact(files): create fileutils
This commit is contained in:
17
lua/telekasten/utils/files.lua
Normal file
17
lua/telekasten/utils/files.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local M = {}
|
||||
|
||||
function M.file_exists(fname)
|
||||
if fname == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
local f = io.open(fname, "r")
|
||||
if f ~= nil then
|
||||
io.close(f)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user