Created
April 19, 2021 19:28
-
-
Save JLHwung/970c52d63fd3b5ee14e3ada1cd227d33 to your computer and use it in GitHub Desktop.
A script to remove empty options.json in babel parser fixtures
This file contains hidden or 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
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