aboutsummaryrefslogtreecommitdiff
path: root/core/cacheClean.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/cacheClean.js')
-rw-r--r--core/cacheClean.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/cacheClean.js b/core/cacheClean.js
new file mode 100644
index 0000000..ed9fb9a
--- /dev/null
+++ b/core/cacheClean.js
@@ -0,0 +1,18 @@
+const fs = require('fs');
+
+function cacheClean(dir) {
+ if (fs.statSync(dir).isDirectory()) {
+ contents = fs.readdirSync(dir);
+ for (item of contents) {
+ cacheClean(dir + "/" + item);
+ }
+ } else if (fs.statSync(dir).isFile()) {
+ if (dir.endsWith("ELECTRODECACHE~.php")) {
+ // fs.unlinkSync(dir);
+ }
+ }
+}
+
+module.exports = () => {
+ cacheClean(publicDir);
+} \ No newline at end of file