Created
December 3, 2020 00:55
-
-
Save zbraniecki/01c8875ff4fa446d9dc95e6f65d86a1b to your computer and use it in GitHub Desktop.
file distribution of DTD files remaining
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const execSync = require('child_process').execSync; | |
const fs = require('fs'); | |
let data = fs.readFileSync('./gh-pages/data/M1/snapshot.json'); | |
let snapshot = JSON.parse(data); | |
let dtdEntities = new Set(); | |
for (let entry of snapshot.data) { | |
if (entry.type !== "dtd") { | |
continue; | |
} | |
dtdEntities.add(entry.id); | |
} | |
let files = {}; | |
for (let id of dtdEntities) { | |
if (id == "brandShortName") { | |
continue; | |
} | |
let result = execSync(`rg "${id}" -g "*.dtd" ~/projects/mozilla-unified -l`).toString().trim(); | |
console.log('===='); | |
console.log(id); | |
console.log(result); | |
if (files[result]) { | |
files[result] += 1; | |
} else { | |
files[result] = 1; | |
} | |
} | |
for (let key in files) { | |
console.log(`${key}: ${files[key]}`); | |
} | |
console.log(Object.keys(files).length); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment