From 3cc931c619def4a5dd119795380a0fbedc7005b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 15 Mar 2024 16:39:07 +0100 Subject: [PATCH] Check if notes path exists --- nvim/lua/plugins/obsidian.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nvim/lua/plugins/obsidian.lua b/nvim/lua/plugins/obsidian.lua index 350596e..428f866 100644 --- a/nvim/lua/plugins/obsidian.lua +++ b/nvim/lua/plugins/obsidian.lua @@ -19,6 +19,9 @@ return { dependencies = { "nvim-lua/plenary.nvim" }, config = function(_, opts) 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 found = false for _, v in ipairs(scan) do