Skip to content

Instantly share code, notes, and snippets.

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 JLHwung/970c52d63fd3b5ee14e3ada1cd227d33 to your computer and use it in GitHub Desktop.
Save JLHwung/970c52d63fd3b5ee14e3ada1cd227d33 to your computer and use it in GitHub Desktop.
A script to remove empty options.json in babel parser fixtures
const glob = require("glob");
const fs = require("fs");
glob(
"./packages/babel-parser/test/fixtures/**/options.json",
{},
function (err, files) {
if (err) throw err;
for (const file of files) {
const contents = JSON.stringify(JSON.parse(fs.readFileSync(file)));
if (contents === "{}" || contents === '{"plugins":[]}') {
fs.unlink(file, () => {});
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment