mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: detect original path before unlinking
This commit is contained in:
parent
ac47b4903c
commit
3070614f40
@ -92,8 +92,9 @@ export class LaanaFileUtils {
|
||||
if (stat.isFile()) {
|
||||
await fsPromises.unlink(cachePath);
|
||||
} else if (stat.isSymbolicLink()) {
|
||||
const originalPath = await fsPromises.readlink(cachePath);
|
||||
await fsPromises.unlink(cachePath);
|
||||
await fsPromises.unlink(await fsPromises.readlink(cachePath));
|
||||
await fsPromises.unlink(originalPath);
|
||||
} else {
|
||||
throw Error('不支持的缓存类型');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user