Skip to content

Commit adc307f

Browse files
committed
Add lang args
1 parent 3627bf2 commit adc307f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/scripts/markdown-checker.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const fs = require("fs")
22
const path = require("path")
33
const matter = require("gray-matter")
4+
const argv = require("minimist")(process.argv.slice(2))
45

6+
const LANG_ARG = argv.lang || null
57
const PATH_TO_INTL_MARKDOWN = "./src/content/translations/"
68
const PATH_TO_ALL_CONTENT = "./src/content/"
79
const TUTORIAL_DATE_REGEX = new RegExp("\\d{4}-\\d{2}-\\d{2}")
@@ -72,7 +74,13 @@ function sortMarkdownPathsIntoLanguages(files) {
7274
? file.slice(langIndex, langIndex + charactersToSlice)
7375
: "en"
7476

75-
languages[lang].push(file)
77+
if (LANG_ARG) {
78+
if (LANG_ARG === lang) {
79+
languages[lang].push(file)
80+
}
81+
} else {
82+
languages[lang].push(file)
83+
}
7684
}
7785

7886
return languages

0 commit comments

Comments
 (0)