You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2019/10/17 14:31:12 UTC

[incubator-echarts-doc] 02/03: fix: build script after mv cn to zh.

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

sushuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-doc.git

commit c4ca21665e3b322df2b9b143678b46b1e450d5cb
Author: SHUANG SU <su...@gmail.com>
AuthorDate: Thu Oct 17 22:25:44 2019 +0800

    fix: build script after mv cn to zh.
---
 build.js   | 16 +++++-----------
 release.sh |  2 +-
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/build.js b/build.js
index 0c40446..25069e3 100644
--- a/build.js
+++ b/build.js
@@ -38,7 +38,7 @@ function initEnv() {
 
 var config = initEnv();
 
-var languages = ['cn', 'en'];
+var languages = ['zh', 'en'];
 
 config.gl = config.gl || {};
 for (var key in config) {
@@ -47,15 +47,10 @@ for (var key in config) {
     }
 }
 
-function getDistLang(lang) {
-    return lang === 'cn' ? 'zh' : lang;
-}
-
 function run() {
     languages.forEach(function (language) {
-        var distLang = getDistLang(language);
-        if (!fs.existsSync('public/' + distLang + '/documents/' + distLang)) {
-            fs.mkdirSync('public/' + distLang + '/documents/' + distLang);
+        if (!fs.existsSync('public/' + language + '/documents/' + language)) {
+            fs.mkdirSync('public/' + language + '/documents/' + language);
         }
         md2json(
             {
@@ -110,7 +105,7 @@ function run() {
         );
 
         fs.writeFileSync(
-            'public/' + distLang + '/documents/' + distLang + '/changelog.html',
+            'public/' + language + '/documents/' + language + '/changelog.html',
             marked(fs.readFileSync(language + '/changelog.md', 'utf-8')),
             'utf-8'
         );
@@ -145,8 +140,7 @@ function run() {
 }
 
 function writeSingleSchema(schema, language, docName, format) {
-    var distLang = getDistLang(language);
-    var path = 'public/documents/' + distLang + '/' + docName + '.json';
+    var path = 'public/documents/' + language + '/' + docName + '.json';
     console.log('output: ' + path);
     fs.writeFileSync(
         path,
diff --git a/release.sh b/release.sh
index a38a4a2..aee0fb3 100644
--- a/release.sh
+++ b/release.sh
@@ -24,7 +24,7 @@ basepath=$(cd `dirname $0`; pwd)
 currPath=$(pwd)
 
 
-# Build cn doc for www.echartsjs.com.
+# Build zh doc for www.echartsjs.com.
 cd ${basepath}
 node ./build.js --env ${envType}
 cd ${currPath}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org