From d858700ff69a01c13cdb2396c8fff3fca8e6fb81 Mon Sep 17 00:00:00 2001 From: Johann Bernhardt Date: Wed, 19 Jun 2024 13:24:04 +0200 Subject: [PATCH 1/2] Skip workspace folders where no diagrams exist --- src/plantuml/exporter/exportWorkSpace.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plantuml/exporter/exportWorkSpace.ts b/src/plantuml/exporter/exportWorkSpace.ts index fb4afa9..36731e7 100644 --- a/src/plantuml/exporter/exportWorkSpace.ts +++ b/src/plantuml/exporter/exportWorkSpace.ts @@ -50,7 +50,14 @@ async function getFileList(para?): Promise { if (!para) { for (let folder of vscode.workspace.workspaceFolders) { - _files.push(...await getFileList(config.diagramsRoot(folder.uri))); + const path = config.diagramsRoot(folder.uri)); + if (fs.existsSync(path)) { + _files.push(...await getFileList(path); + } + else { + console.log(`Skipping - Does not exist: {path}`); + } + } } else if (para instanceof Array) { for (let u of para.filter(p => p instanceof vscode.Uri)) { @@ -137,4 +144,4 @@ function doBuild(files: FileAndFormat[]) { } } ); -} \ No newline at end of file +} From 126ec08bba0bbd506ba321ffe1fb70f4572111b2 Mon Sep 17 00:00:00 2001 From: Johann Bernhardt Date: Thu, 20 Jun 2024 09:41:46 +0200 Subject: [PATCH 2/2] Test and fix --- src/plantuml/exporter/exportWorkSpace.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plantuml/exporter/exportWorkSpace.ts b/src/plantuml/exporter/exportWorkSpace.ts index 36731e7..a5cc08f 100644 --- a/src/plantuml/exporter/exportWorkSpace.ts +++ b/src/plantuml/exporter/exportWorkSpace.ts @@ -50,14 +50,10 @@ async function getFileList(para?): Promise { if (!para) { for (let folder of vscode.workspace.workspaceFolders) { - const path = config.diagramsRoot(folder.uri)); - if (fs.existsSync(path)) { - _files.push(...await getFileList(path); + const path = config.diagramsRoot(folder.uri); + if (fs.existsSync(path.fsPath)) { + _files.push(...await getFileList(path)); } - else { - console.log(`Skipping - Does not exist: {path}`); - } - } } else if (para instanceof Array) { for (let u of para.filter(p => p instanceof vscode.Uri)) {