Check if notes path exists
This commit is contained in:
parent
afe7b22bcb
commit
3cc931c619
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue