You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2022/02/17 08:31:25 UTC

[pulsar-site] 03/04: update migrate scripts

This is an automated email from the ASF dual-hosted git repository.

urfree pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit 7b09a265d26186354270e920db87fe42a207f3c3
Author: LiLi <ur...@apache.org>
AuthorDate: Thu Feb 17 16:29:56 2022 +0800

    update migrate scripts
    
    Signed-off-by: LiLi <ur...@apache.org>
---
 site2/website-next/migrate/migrate-docs.js | 4 ++++
 site2/website-next/migrate/tool/find-md.js | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/site2/website-next/migrate/migrate-docs.js b/site2/website-next/migrate/migrate-docs.js
index 31f09a1..9b727c0 100644
--- a/site2/website-next/migrate/migrate-docs.js
+++ b/site2/website-next/migrate/migrate-docs.js
@@ -11,6 +11,7 @@ function migrate(version, chapter, docsId, cb) {
   if (version == "next") {
     dest = "../../" + next.docsDir;
   }
+  let destDir = path.join(__dirname, dest);
   dest = path.join(__dirname, dest, docsId + ".md");
   let mdpath = findMd(version, docsId);
   if (mdpath) {
@@ -27,6 +28,9 @@ function migrate(version, chapter, docsId, cb) {
     );
     let data = fs.readFileSync(mdpath, "utf8");
     data = fixMd(data, version);
+    if (!fs.existsSync(destDir)) {
+      fs.mkdirSync(destDir);
+    }
     fs.writeFileSync(dest, data);
     cb && cb(docsId);
   } else {
diff --git a/site2/website-next/migrate/tool/find-md.js b/site2/website-next/migrate/tool/find-md.js
index 1429be7..98b5268 100644
--- a/site2/website-next/migrate/tool/find-md.js
+++ b/site2/website-next/migrate/tool/find-md.js
@@ -50,7 +50,7 @@ const _search = (dir, version, docsId, reg) => {
     }
     let data = fs.readFileSync(pathname, "utf8");
     if (reg.test(data)) {
-      console.log("         [" + version + ":" + docsId + "]fund: " + pathname);
+      console.log("         ******[" + version + ":" + docsId + "]fund: " + pathname);
       return pathname;
     }
   }