From ea557079f0d20ff6437eb9d0eac2b8197403f193 Mon Sep 17 00:00:00 2001 From: Loic Duong Date: Fri, 19 Jun 2026 10:16:03 +0700 Subject: [PATCH] fix(installer): preserve posix custom-source cache paths --- tools/installer/modules/custom-module-manager.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/installer/modules/custom-module-manager.js b/tools/installer/modules/custom-module-manager.js index 77f3fe6ed..5c47d0d8f 100644 --- a/tools/installer/modules/custom-module-manager.js +++ b/tools/installer/modules/custom-module-manager.js @@ -414,13 +414,14 @@ class CustomModuleManager { /** * Convert a stable cache key into filesystem-safe path segments. - * Keep parseSource().cacheKey human-readable while avoiding invalid - * characters such as ":" from custom SSH ports on Windows. + * Preserve the historical on-disk layout except on Windows, where ":" from + * custom SSH ports is invalid inside a path segment. * @param {string} cacheKey - Parsed cache key * @returns {string} Filesystem path for the cached clone */ _getRepoCacheDir(cacheKey) { - const safeSegments = cacheKey.split('/').map((segment) => segment.replaceAll(':', '__port_')); + const segments = cacheKey.split('/'); + const safeSegments = process.platform === 'win32' ? segments.map((segment) => segment.replaceAll(':', '__port_')) : segments; return path.join(this.getCacheDir(), ...safeSegments); }