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 2021/09/22 01:27:09 UTC

[echarts-website] branch asf-site updated: fix format flaw

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

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


The following commit(s) were added to refs/heads/asf-site by this push:
     new 4a16cc4  fix format flaw
4a16cc4 is described below

commit 4a16cc4c7bd685469442251e543d4baaa1163c7e
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Wed Sep 22 09:26:39 2021 +0800

    fix format flaw
---
 .scripts/purgeCDN.js | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/.scripts/purgeCDN.js b/.scripts/purgeCDN.js
index 8af4d8f..ab6a5ab 100644
--- a/.scripts/purgeCDN.js
+++ b/.scripts/purgeCDN.js
@@ -1,3 +1,5 @@
+// TODO no permission to run non-verified action
+
 const {runTasks} = require('./task');
 const fetch = require('node-fetch').default;
 const argv = require('minimist')(process.argv.slice(2));
@@ -5,7 +7,7 @@ const argv = require('minimist')(process.argv.slice(2));
 const files = typeof argv.files === 'string' && argv.files.split(',');
 
 if (!files || !files.length) {
-	return console.log('No files to be purged');
+    return console.log('No files to be purged');
 }
 
 function getCdnUrl(fileUrl) {
@@ -18,7 +20,7 @@ function getPurgeUrl(fileUrl) {
 
 function purge(url) {
     return fetch(encodeURI(url))
-		.then(res => res.json())
+        .then(res => res.json())
         .then(res => {
             if (res.status === 'finished') {
                 console.log('Purged', url);
@@ -30,24 +32,24 @@ function purge(url) {
 }
 
 async function run() {
-	console.log(`Purging ${files.length} changed files...`);
-
-	const totalLen = files.length;
-	let finished = 0;
-	let purged = 0;
-	await runTasks(files, async(filePath) => {
-		try {
-			await purge(getPurgeUrl(filePath));
-			purged++;
-		}
-		catch (e) {
-			console.error('failed to purge', filePath);
-			console.error(e);
-		}
-		finished++;
-		console.log(`${finished} / ${totalLen} (${(finished / totalLen * 100).toFixed(0)}%)`)
-	}, 10);
-	console.log(`Purged ${purged} successfully`);
+    console.log(`Purging ${files.length} changed files...`);
+
+    const totalLen = files.length;
+    let finished = 0;
+    let purged = 0;
+    await runTasks(files, async(filePath) => {
+        try {
+            await purge(getPurgeUrl(filePath));
+            purged++;
+        }
+        catch (e) {
+            console.error('failed to purge', filePath);
+            console.error(e);
+        }
+        finished++;
+        console.log(`${finished} / ${totalLen} (${(finished / totalLen * 100).toFixed(0)}%)`)
+    }, 10);
+    console.log(`Purged ${purged} successfully`);
 }
 
 run();
\ No newline at end of file

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