You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/11/15 08:25:58 UTC

[echarts-examples] branch gh-pages updated: fix(tool): fix compatibility in Windows.

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

wangzx pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git


The following commit(s) were added to refs/heads/gh-pages by this push:
     new bbe3a70b fix(tool): fix compatibility in Windows.
bbe3a70b is described below

commit bbe3a70bedc27d487cc2bf3b416f089a0656b8a4
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Tue Nov 15 16:25:13 2022 +0800

    fix(tool): fix compatibility in Windows.
---
 public/examples/ts/gauge-grade.ts | 2 +-
 tool/build-example.js             | 5 ++++-
 tool/compile-example.js           | 7 +++++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/public/examples/ts/gauge-grade.ts b/public/examples/ts/gauge-grade.ts
index cda1ec1d..5aec2ec4 100644
--- a/public/examples/ts/gauge-grade.ts
+++ b/public/examples/ts/gauge-grade.ts
@@ -78,7 +78,7 @@ option = {
         offsetCenter: [0, '-35%'],
         valueAnimation: true,
         formatter: function (value: number) {
-          return Math.round(value * 100);
+          return Math.round(value * 100) + '';
         },
         color: 'auto'
       },
diff --git a/tool/build-example.js b/tool/build-example.js
index fa228c4f..656fde4e 100644
--- a/tool/build-example.js
+++ b/tool/build-example.js
@@ -266,7 +266,10 @@ async function takeScreenshot(
   const screenshotBlackList = [];
 
   const examplesRoot = `${rootDir}public/examples`;
-  const files = await globby(`${examplesRoot}/js/${isGL ? 'gl/' : ''}*.js`);
+  const files = await globby(`js/${isGL ? 'gl/' : ''}*.js`, {
+    cwd: examplesRoot,
+    absolute: true
+  });
 
   const exampleList = [];
 
diff --git a/tool/compile-example.js b/tool/compile-example.js
index 7840baaa..54296dd9 100644
--- a/tool/compile-example.js
+++ b/tool/compile-example.js
@@ -11,9 +11,12 @@ async function run() {
       .code !== 0;
   shell.exec(`prettier --write ${path.join(exampleDir, 'js')}`);
 
-  const files = await globby(path.join(exampleDir, `js/**/*.js`));
+  const files = await globby('js/**/*.js', {
+    cwd: exampleDir,
+    absolute: true
+  });
 
-  for (let file of files) {
+  for (const file of files) {
     const content =
       fs
         .readFileSync(file, 'utf-8')


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