summary refs log tree commit diff
path: root/scripts/build/clean_cache.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/clean_cache.js')
-rw-r--r--scripts/build/clean_cache.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/build/clean_cache.js b/scripts/build/clean_cache.js
new file mode 100644
index 00000000..5a18ee9d
--- /dev/null
+++ b/scripts/build/clean_cache.js
@@ -0,0 +1,14 @@
+const { execSync } = require("child_process");
+const path = require("path");
+const fs = require("fs");
+const { argv, stdout, exit } = require("process");
+const { execIn, parts, getDirs, walk, sanitizeVarName } = require("../utils");
+
+module.exports = function (config) {
+	console.log(`==> Cleaning asset cache...`);
+	const assetDir = path.resolve(path.join(config.rootDir, "assets", "cache"));
+	if (fs.existsSync(assetDir)) {
+		fs.rmSync(assetDir, { recursive: true });
+		if (config.verbose) console.log(`Deleted ${assetDir}!`);
+	}
+};