mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Fix badge bad name + prevent Unicode replacement characters in the check script
This commit is contained in:
parent
3e128adaa4
commit
1d03ac784b
|
|
@ -1204,7 +1204,7 @@
|
|||
"authorDiscordId": "338806780446638082"
|
||||
},
|
||||
"torneoes": {
|
||||
"displayName": "PEÑA Tournament",
|
||||
"displayName": "PEÑA Tournament",
|
||||
"authorDiscordId": "752582395076673577"
|
||||
},
|
||||
"tralalero": {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ for (const key of Object.keys(badges)) {
|
|||
lastKey = key;
|
||||
}
|
||||
|
||||
// check for duplicate displayName values
|
||||
// check for duplicate displayName values and encoding issues
|
||||
const displayNames = new Map<string, string>();
|
||||
for (const [key, badge] of Object.entries(badges)) {
|
||||
const existingKey = displayNames.get(badge.displayName);
|
||||
|
|
@ -46,6 +46,14 @@ for (const [key, badge] of Object.entries(badges)) {
|
|||
process.exit(1);
|
||||
}
|
||||
displayNames.set(badge.displayName, key);
|
||||
|
||||
// check for Unicode replacement characters (encoding issues)
|
||||
if (badge.displayName.includes("\uFFFD")) {
|
||||
console.error(
|
||||
`Invalid encoding in displayName for badge "${key}": contains replacement character (<28>). This usually means the file was saved with incorrect encoding.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// check each key has the 3 matching files in the right location
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user