From c78bd6d27310d65be328467313e36ff2990b69cf Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:49:18 +0100 Subject: [PATCH] fix(tool/gather-git-history): skip German locale (#12120) * fix(gather-git-history): skip if locale directory does not exist * chore(gather-git-history): skip de --- tool/cli.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tool/cli.ts b/tool/cli.ts index 215f189aacfb..268c48db208e 100644 --- a/tool/cli.ts +++ b/tool/cli.ts @@ -630,7 +630,7 @@ program const allHistory = {}; for (const [relPath, value] of map) { const locale = relPath.split(path.sep)[0]; - if (!isValidLocale(locale)) { + if (!isValidLocale(locale) && locale !== "de") { continue; } allHistory[relPath] = value; @@ -652,7 +652,12 @@ program return 0; }); const root = getRoot(locale); - const outputFile = path.join(root, locale, "_githistory.json"); + const outputDir = path.join(root, locale); + if (!fs.existsSync(outputDir)) { + console.log(chalk.yellow(`Skipping ${locale}`)); + continue; + } + const outputFile = path.join(outputDir, "_githistory.json"); fs.writeFileSync( outputFile, JSON.stringify(Object.fromEntries(sorted), null, 2),