Skip to content

Instantly share code, notes, and snippets.

@darkwing
Created August 1, 2019 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkwing/37ce7c59f937e36cba02fcb6711328bc to your computer and use it in GitHub Desktop.
Save darkwing/37ce7c59f937e36cba02fcb6711328bc to your computer and use it in GitHub Desktop.
const { spawn, execSync } = require("child_process");
const localeKeys = execSync(
"grep -Eo '^([A-z0-9.]+)' devtools/client/locales/en-US/debugger.properties"
)
.toString()
.split("\n")
.filter(Boolean);
const unusedKeys = localeKeys.filter(key => {
const results = execSync(
`grep -ro '${key}' devtools/client/debugger/src/ | wc -l | xargs`
)
.toString()
.split("\n");
//console.log(`results for ${key} is: ${results}`);
return Number(results.toString().replace(",", "")) == 0;
});
console.log("-------------------------");
console.log("Unused keys: \n", unusedKeys.join("\n"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment