We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7618e7e commit 83213faCopy full SHA for 83213fa
lua/cd-project/project-repo.lua
@@ -6,7 +6,15 @@ local json = require("cd-project.json")
6
7
---@return CdProject.Project[]
8
local get_projects = function()
9
- return json.read_or_init_json_file(vim.g.cd_project_config.projects_config_filepath)
+ local json = json.read_or_init_json_file(vim.g.cd_project_config.projects_config_filepath)
10
+
11
+ -- Filter out projects whose directory does not exit
12
+ local existing_projects = vim.tbl_filter(function(p)
13
+ return vim.fn.isdirectory(p.path) == 1
14
+ end, json)
15
16
+ return existing_projects
17
18
end
19
20
---@param projects CdProject.Project[]
0 commit comments