Skip to content

Commit

Permalink
fix(tool/gather-git-history): skip German locale (#12120)
Browse files Browse the repository at this point in the history
* fix(gather-git-history): skip if locale directory does not exist

* chore(gather-git-history): skip de
  • Loading branch information
caugner authored Nov 12, 2024
1 parent 99b6e62 commit c78bd6d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tool/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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),
Expand Down

0 comments on commit c78bd6d

Please sign in to comment.