Check if notes path exists

This commit is contained in:
Thomas Avé 2024-03-15 16:39:07 +01:00
parent afe7b22bcb
commit 3cc931c619
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ return {
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
config = function(_, opts) config = function(_, opts)
local notes_path = (os.getenv "HOME") .. "/Workspace/Notes" local notes_path = (os.getenv "HOME") .. "/Workspace/Notes"
if vim.fn.isdirectory(notes_path) == 0 then
return
end
local scan = require("plenary.scandir").scan_dir(notes_path, {add_dirs = true, depth = 1 }) local scan = require("plenary.scandir").scan_dir(notes_path, {add_dirs = true, depth = 1 })
local found = false local found = false
for _, v in ipairs(scan) do for _, v in ipairs(scan) do