mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 11:19:10 +08:00
Fix/fs-rmdir-deprecation (#3296)
This commit is contained in:
parent
65d7e24aef
commit
96cd207b1b
@ -271,12 +271,12 @@ class FileStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public clear = async (): Promise<void> => {
|
public clear = async (): Promise<void> => {
|
||||||
await fs.promises.rmdir(this.storageDir, { recursive: true })
|
await fs.promises.rm(this.storageDir, { recursive: true })
|
||||||
await this.initStorageDir()
|
await this.initStorageDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
public clearTemp = async (): Promise<void> => {
|
public clearTemp = async (): Promise<void> => {
|
||||||
await fs.promises.rmdir(this.tempDir, { recursive: true })
|
await fs.promises.rm(this.tempDir, { recursive: true })
|
||||||
await fs.promises.mkdir(this.tempDir, { recursive: true })
|
await fs.promises.mkdir(this.tempDir, { recursive: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user