fix(installer): preserve posix custom-source cache paths
This commit is contained in:
parent
87d194b93e
commit
ea557079f0
|
|
@ -414,13 +414,14 @@ class CustomModuleManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a stable cache key into filesystem-safe path segments.
|
* Convert a stable cache key into filesystem-safe path segments.
|
||||||
* Keep parseSource().cacheKey human-readable while avoiding invalid
|
* Preserve the historical on-disk layout except on Windows, where ":" from
|
||||||
* characters such as ":" from custom SSH ports on Windows.
|
* custom SSH ports is invalid inside a path segment.
|
||||||
* @param {string} cacheKey - Parsed cache key
|
* @param {string} cacheKey - Parsed cache key
|
||||||
* @returns {string} Filesystem path for the cached clone
|
* @returns {string} Filesystem path for the cached clone
|
||||||
*/
|
*/
|
||||||
_getRepoCacheDir(cacheKey) {
|
_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);
|
return path.join(this.getCacheDir(), ...safeSegments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue