mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Fix error prompted when uninstalling BSIPA but in fact was successfully uninstalled (#973)
This commit is contained in:
@@ -32,7 +32,7 @@ export async function deleteFile(filepath: string) {
|
||||
log.info("Deleting file", `"${filepath}"`);
|
||||
await unlink(filepath);
|
||||
} catch (error: any) {
|
||||
log.error("Could not delete file", `"${filepath}"`);
|
||||
log.error("Could not delete file", `"${filepath}"`, error);
|
||||
throw CustomError.fromError(error, "generic.fs.delete-file");
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export function deleteFileSync(filepath: string) {
|
||||
log.info("Deleting file", `"${filepath}"`);
|
||||
unlinkSync(filepath);
|
||||
} catch (error: any) {
|
||||
log.error("Could not delete file", `"${filepath}"`);
|
||||
log.error("Could not delete file", `"${filepath}"`, error);
|
||||
throw CustomError.fromError(error, "generic.fs.delete-file");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,9 @@ export class BsModsManagerService {
|
||||
|
||||
const promises = mod.version.contentHashes.map(content => {
|
||||
const file = content.path.replaceAll("IPA/", "").replaceAll("Data", "Beat Saber_Data");
|
||||
return deleteFile(path.join(verionPath, file));
|
||||
return deleteFile(path.join(verionPath, file)).catch(err => {
|
||||
log.info("Unable to delete IPA file, likely because it has been removed by the --revert command. Here is the error:", err);
|
||||
});
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
|
||||
Reference in New Issue
Block a user