[repo] desacoplamento e maior coesão
This commit is contained in:
9
src/utils/file.js
Normal file
9
src/utils/file.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export function emptyFolder(folder) {
|
||||
fs.readdirSync(folder).forEach(file => {
|
||||
const filePath = path.join(folder, file);
|
||||
if (fs.lstatSync(filePath).isFile()) fs.unlinkSync(filePath);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user