Skip to content

Commit f01b0aa

Browse files
committed
debug: add console logs
1 parent fc49c79 commit f01b0aa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/scripts/crowdin/translations/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export const decompressFile = async (filePath: string, targetDir: string) => {
4141
}
4242

4343
const getQAMessage = (locale: string) => {
44+
console.log("Checking summary path:", SUMMARY_PATH)
45+
if (!fs.existsSync(SUMMARY_PATH)) {
46+
console.error("Could not find summary path:", SUMMARY_PATH)
47+
throw new Error("No summary file found.")
48+
}
49+
4450
const summaryJson: QASummary = JSON.parse(readFileSync(SUMMARY_PATH, "utf-8"))
4551
const qaResults = summaryJson[locale]
4652
? summaryJson[locale].map((s) => "- " + s).join("\n")

src/scripts/markdownChecker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ const writeSummary = (summary: Summary, summaryWritePath: string) => {
368368
}
369369

370370
export function checkMarkdown(summaryWritePath?: string) {
371+
console.log("Checking markdown for common issues...")
371372
const summary = {} as Summary
372373
const markdownPaths: Array<string> = getAllMarkdownPaths(PATH_TO_ALL_CONTENT)
373374
const markdownPathsByLang: Languages =
@@ -383,8 +384,10 @@ export function checkMarkdown(summaryWritePath?: string) {
383384

384385
if (!summary[lang].length) delete summary[lang]
385386
}
387+
if (!summaryWritePath) return
386388

387-
summaryWritePath && writeSummary(summary, summaryWritePath)
389+
writeSummary(summary, summaryWritePath)
390+
console.log("Writing markdown checker summary to:", summaryWritePath)
388391
}
389392

390393
checkMarkdown()

0 commit comments

Comments
 (0)