Skip to content

Commit

Permalink
Change create wiki log text for more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
ihavecoke committed Jun 15, 2024
1 parent 961bdd2 commit 24a4434
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/wiki/sync-wikis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ export async function generateWikiMD(wiki: IWiki) {
} else {
docDir = `${projectRoot}/i18n/${locale}/docusaurus-plugin-content-docs/current/learn/wiki`;
}

const docPath = `${docDir}/${wiki.slug}.mdx`;
const dirname = path.dirname(docPath);
if (!fs.existsSync(dirname)) {
fs.mkdirSync(dirname, { recursive: true });
}
console.log(`-> create doc: ${docPath}`);
if (fs.existsSync(docPath)) {
console.log(`==> update doc: ${docPath}`);
} else {
console.log(`==> create doc: ${docPath}`);
}
var compiled = _template(template);
const docContent = compiled(wikiUtils.toPage());
fs.writeFileSync(docPath, docContent);
Expand All @@ -53,7 +56,7 @@ export async function updateLatestWiki(limit = 100) {
const content_updated_at = await fetchLastUpdatedValue();
await fetchWikiList(wikis, content_updated_at, limit);
wikis = uniqBy(wikis, "slug");
console.log('--> found matched wikis:', wikis.length)
console.log("--> found matched wikis:", wikis.length);
const theLatestWiki = wikis[0];
if (theLatestWiki) {
fetchLastUpdatedValue(theLatestWiki.content_updated_at);
Expand Down

0 comments on commit 24a4434

Please sign in to comment.