mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
This commit is contained in:
parent
ba2e86c7ef
commit
08c5c401ba
1 changed files with 6 additions and 4 deletions
|
|
@ -35,9 +35,11 @@ const version = await Bun.file(path.join(Global.Path.cache, "version"))
|
|||
.catch(() => "0")
|
||||
|
||||
if (version !== CACHE_VERSION) {
|
||||
const contents = await fs.readdir(Global.Path.cache)
|
||||
await Promise.all(
|
||||
contents.map((item) => fs.rm(path.join(Global.Path.cache, item), { recursive: true, force: true })),
|
||||
)
|
||||
try {
|
||||
const contents = await fs.readdir(Global.Path.cache)
|
||||
await Promise.all(
|
||||
contents.map((item) => fs.rm(path.join(Global.Path.cache, item), { recursive: true, force: true })),
|
||||
)
|
||||
} catch (e) {}
|
||||
await Bun.file(path.join(Global.Path.cache, "version")).write(CACHE_VERSION)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue