|
|
@@ -23,7 +23,17 @@ export namespace Global {
|
|
|
await Promise.all([
|
|
|
fs.mkdir(Global.Path.data, { recursive: true }),
|
|
|
fs.mkdir(Global.Path.config, { recursive: true }),
|
|
|
- fs.mkdir(Global.Path.cache, { recursive: true }),
|
|
|
fs.mkdir(Global.Path.providers, { recursive: true }),
|
|
|
fs.mkdir(Global.Path.state, { recursive: true }),
|
|
|
])
|
|
|
+
|
|
|
+const CACHE_VERSION = "1"
|
|
|
+
|
|
|
+const version = await Bun.file(path.join(Global.Path.cache, "version"))
|
|
|
+ .text()
|
|
|
+ .catch(() => "0")
|
|
|
+
|
|
|
+if (version !== CACHE_VERSION) {
|
|
|
+ await fs.rm(Global.Path.cache, { recursive: true, force: true })
|
|
|
+ await Bun.file(path.join(Global.Path.cache, "version")).write(CACHE_VERSION)
|
|
|
+}
|