mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
chore(forge): make the removed locales list more compact
This commit is contained in:
parent
77497dbc28
commit
9a2264c7f6
@ -148,6 +148,7 @@ module.exports = {
|
||||
.filter(locale => !locale.contentOnly)
|
||||
.map(locale => locale.electronLocale.replace("_", "-"));
|
||||
const keptLocales = new Set();
|
||||
const removedLocales = [];
|
||||
|
||||
for (const outputPath of packageResult.outputPaths) {
|
||||
const localesDir = path.join(outputPath, 'locales');
|
||||
@ -166,12 +167,14 @@ module.exports = {
|
||||
continue;
|
||||
}
|
||||
|
||||
console.log(`Removing unused locale file: ${file}`);
|
||||
const filePath = path.join(localesDir, file);
|
||||
fs.unlinkSync(filePath);
|
||||
removedLocales.push(file);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Removed unused locale files: ${removedLocales.join(", ")}`);
|
||||
|
||||
// Ensure all locales that should be kept are actually present.
|
||||
for (const locale of localesToKeep) {
|
||||
if (!keptLocales.has(locale)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user