mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
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:
committed by
GitHub
parent
75a0376132
commit
0238a1e10a
10
scripts/remove-empty.js
Normal file
10
scripts/remove-empty.js
Normal 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 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user