mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
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`.
11 lines
324 B
JavaScript
11 lines
324 B
JavaScript
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 })
|
|
}
|
|
}
|