Created
January 23, 2019 05:17
-
-
Save oieduardorabelo/62877fe7fb85708ef5b283b8e52c8984 to your computer and use it in GitHub Desktop.
This file contains 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 fs = require('fs'); | |
const cp = require('child_process'); | |
const testFolder = './src'; | |
function getFiles(dir, files_ = []) { | |
const files = fs.readdirSync(dir); | |
Object.values(files).forEach((fileName) => { | |
const name = `${dir}/${fileName}`; | |
if (fs.statSync(name).isDirectory()) { | |
getFiles(name, files_); | |
} else if (name.endsWith('scss.d.ts')) { | |
files_.push(name); | |
} | |
}); | |
return files_; | |
} | |
getFiles(testFolder).forEach((fileNameWithPath) => { | |
cp.exec(`rm -rf ${fileNameWithPath}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment