small bugfixes #18
|
@ -277,11 +277,17 @@ async function downloadEZPPLauncherUpdateFiles(osuPath, updateFiles) {
|
|||
//NOTE: check if the folder is not the osu root folder.
|
||||
if (path.basename(pruneFolder) == "osu!")
|
||||
continue;
|
||||
if (fs.existsSync(pruneFolder)) {
|
||||
for (const files of await fs.promises.readdir(pruneFolder)) {
|
||||
const filePath = path.join(pruneFolder, files);
|
||||
if (!updateFiles.some(file => path.join(osuPath, ...file.folder.split("/"), file.name) === filePath)) {
|
||||
|
||||
eventEmitter.emit("data", {
|
||||
fileName: path.basename(filePath),
|
||||
});
|
||||
try {
|
||||
await fs.promises.rm(filePath, { recursive: true, force: true });
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
11
main.js
11
main.js
|
@ -587,6 +587,15 @@ function registerIPCPipes() {
|
|||
}/${formatBytes(data.total)})...`,
|
||||
});
|
||||
});
|
||||
patcherDownloader.eventEmitter.on("delete", (data) => {
|
||||
logger.log(`Deleting ${data.fileName}!`);
|
||||
mainWindow.webContents.send("ezpplauncher:launchprogress", {
|
||||
progress: -1,
|
||||
});
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: `Deleting ${data.fileName}...`,
|
||||
});
|
||||
});
|
||||
await patcherDownloader.startDownload();
|
||||
mainWindow.webContents.send("ezpplauncher:launchprogress", {
|
||||
progress: -1,
|
||||
|
@ -664,7 +673,7 @@ function registerIPCPipes() {
|
|||
if (fs.existsSync(updateFile)) {
|
||||
await fs.promises.rm(updateFile, {
|
||||
force: true,
|
||||
recursive: (await fs.promises.lstat(updateFile)).isDirectory,
|
||||
recursive: (await fs.promises.lstat(updateFile)).isDirectory(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user