From de256436f60e0c6a694ad0d1ae0a795dfc657f41 Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Sat, 31 May 2025 12:09:37 -0700 Subject: [PATCH] Fix: Handle docker build trying to access empty plugin directory not being created by docker copy --- build.plugins.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.plugins.js b/build.plugins.js index c7fcde93..cab0daa7 100644 --- a/build.plugins.js +++ b/build.plugins.js @@ -1,4 +1,4 @@ -const { readdirSync, statSync, writeFileSync } = require('fs'); +const { readdirSync, statSync, writeFileSync, existsSync } = require('fs'); const { join } = require('path'); function isNonEmptyFolder(folderPath) { @@ -18,6 +18,10 @@ function isNonEmptyFolder(folderPath) { // Function to get all non-empty folders function getNonEmptyFolders(rootFolder) { const result = []; + if (!existsSync(rootFolder)) { + return result; + } + const items = readdirSync(rootFolder); items.forEach((item) => {