mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-12 00:04:02 +02:00
Merge pull request #20755 from Snuffleupagus/rm-unmaintained-locales
Automatically remove unmaintained locales when running `gulp importl10n`
This commit is contained in:
commit
218a687a3b
11
external/importL10n/locales.mjs
vendored
11
external/importL10n/locales.mjs
vendored
@ -91,7 +91,7 @@ async function downloadL10n(root) {
|
||||
await downloadLanguageFiles(root, langCode);
|
||||
}
|
||||
|
||||
const removeCodes = [];
|
||||
const rmCodes = [];
|
||||
for (const entry of fs.readdirSync(root)) {
|
||||
const dirPath = path.join(root, entry),
|
||||
stat = fs.lstatSync(dirPath);
|
||||
@ -101,14 +101,13 @@ async function downloadL10n(root) {
|
||||
entry !== DEFAULT_LOCALE &&
|
||||
!langCodes.includes(entry)
|
||||
) {
|
||||
removeCodes.push(entry);
|
||||
fs.rmSync(dirPath, { recursive: true, force: true });
|
||||
rmCodes.push(entry);
|
||||
}
|
||||
}
|
||||
if (removeCodes.length) {
|
||||
if (rmCodes.length) {
|
||||
console.log(
|
||||
"\nConsider removing the following unmaintained locales:\n" +
|
||||
removeCodes.join(", ") +
|
||||
"\n"
|
||||
`\nRemoved the following unmaintained locales: ${rmCodes.join(", ")}\n`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user