mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-01 11:57:20 +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);
|
await downloadLanguageFiles(root, langCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
const removeCodes = [];
|
const rmCodes = [];
|
||||||
for (const entry of fs.readdirSync(root)) {
|
for (const entry of fs.readdirSync(root)) {
|
||||||
const dirPath = path.join(root, entry),
|
const dirPath = path.join(root, entry),
|
||||||
stat = fs.lstatSync(dirPath);
|
stat = fs.lstatSync(dirPath);
|
||||||
@ -101,14 +101,13 @@ async function downloadL10n(root) {
|
|||||||
entry !== DEFAULT_LOCALE &&
|
entry !== DEFAULT_LOCALE &&
|
||||||
!langCodes.includes(entry)
|
!langCodes.includes(entry)
|
||||||
) {
|
) {
|
||||||
removeCodes.push(entry);
|
fs.rmSync(dirPath, { recursive: true, force: true });
|
||||||
|
rmCodes.push(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (removeCodes.length) {
|
if (rmCodes.length) {
|
||||||
console.log(
|
console.log(
|
||||||
"\nConsider removing the following unmaintained locales:\n" +
|
`\nRemoved the following unmaintained locales: ${rmCodes.join(", ")}\n`
|
||||||
removeCodes.join(", ") +
|
|
||||||
"\n"
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user