Add 'clean' script to package.json (#53442)

It removes empty folders from now-removed packages so that test-all will
run without complaining. Also removes folders that are empty except for
`node_modules`.
This commit is contained in:
Nathan Shively-Sanders
2021-05-27 10:34:44 -07:00
committed by GitHub
parent 75a0376132
commit 0238a1e10a
2 changed files with 11 additions and 0 deletions

10
scripts/remove-empty.js Normal file
View File

@@ -0,0 +1,10 @@
const fs = require('fs')
const path = require('path')
for (const d of fs.readdirSync("../types")) {
const dir = path.join("../types", d)
const files = fs.readdirSync(dir)
if (files.length === 0 || files.length === 1) {
console.log("Deleting unused directory", dir)
fs.rmdirSync(dir, { recursive: true })
}
}