mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: handle dotted reserved snapshot names
This commit is contained in:
parent
61992f7f5e
commit
841beea45c
2 changed files with 19 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue