Added telemetry script.

This commit is contained in:
Mike Cao 2022-03-16 21:50:24 -07:00
parent 3717b0e888
commit 45e4bfe3a9
6 changed files with 162 additions and 31 deletions

View file

@ -1,4 +1,4 @@
const fs = require('fs');
const fs = require('fs-extra');
const path = require('path');
const https = require('https');
const chalk = require('chalk');
@ -16,11 +16,9 @@ const asyncForEach = async (array, callback) => {
}
};
if (!fs.existsSync(dest)) {
fs.mkdirSync(dest);
}
const download = async files => {
await fs.ensureDir(dest);
await asyncForEach(files, async file => {
const locale = file.replace('-', '_').replace('.json', '');