From 60dc4560a714f2ce04aeb178dfd316217dbfba13 Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Wed, 12 Aug 2026 13:50:16 +0200 Subject: [PATCH] fix: Handle spaces in repo path when building n8n for docker (no-changelog) --- scripts/build-n8n.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build-n8n.mjs b/scripts/build-n8n.mjs index e21d731582d..cefe9fd0fb5 100755 --- a/scripts/build-n8n.mjs +++ b/scripts/build-n8n.mjs @@ -10,6 +10,7 @@ import { $, echo, fs, chalk } from 'zx'; import path from 'path'; +import { fileURLToPath } from 'url'; // Check if running in a CI environment const isCI = process.env.CI === 'true'; @@ -22,7 +23,8 @@ const excludeTestController = $.verbose = !isCI; process.env.FORCE_COLOR = isCI ? '0' : '1'; -const scriptDir = path.dirname(new URL(import.meta.url).pathname); +// fileURLToPath (not URL.pathname) so paths with spaces stay valid +const scriptDir = path.dirname(fileURLToPath(import.meta.url)); const isInScriptsDir = path.basename(scriptDir) === 'scripts'; const rootDir = isInScriptsDir ? path.join(scriptDir, '..') : scriptDir;