Skip to content

Instantly share code, notes, and snippets.

@oieduardorabelo
Created January 23, 2019 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oieduardorabelo/62877fe7fb85708ef5b283b8e52c8984 to your computer and use it in GitHub Desktop.
Save oieduardorabelo/62877fe7fb85708ef5b283b8e52c8984 to your computer and use it in GitHub Desktop.
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