mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-26 18:35:05 +00:00
fix: handle dotted reserved snapshot names
This commit is contained in:
1 parent
61992f7f5e
commit
841beea45c
2 files changed
+19
-7
No files matched your search
@@ -626,7 +626,12 @@ function sanitizeSnapshotName(value, fallback = 'session') {
|
||||
return sanitized;
|
||||
}
|
||||
if (sanitized && isWindowsReservedBasename(sanitized)) {
|
||||
return `${sanitized}-${hashString(raw).slice(0, 8)}`;
|
||||
const firstDotIndex = sanitized.indexOf('.');
|
||||
const hashSuffix = hashString(raw).slice(0, 8);
|
||||
if (firstDotIndex === -1) {
|
||||
return `${sanitized}-${hashSuffix}`;
|
||||
}
|
||||
return `${sanitized.slice(0, firstDotIndex)}-${hashSuffix}${sanitized.slice(firstDotIndex)}`;
|
||||
}
|
||||
|
||||
const prefix = sanitized ? sanitized.slice(0, 48).replace(/[._-]+$/g, '') : fallback;
|
||||
|
||||
Reference in new issue
Block a user