summary refs log tree commit diff
path: root/scripts/build/clean_cache.js
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-09-17 13:17:12 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-09-17 13:17:12 +0200
commitb3a3ea2ff1a391872f10883dba27b828497cfd2e (patch)
treec8fdfa3f246c4660cb688baad4aa58879e46c3bd /scripts/build/clean_cache.js
parentMore patches (diff)
downloadserver-b3a3ea2ff1a391872f10883dba27b828497cfd2e.tar.xz
Better patch system dev/rory/client_patching
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}!`); + } +};