Compare commits

..

No commits in common. "3bd1fb9edb18e594d61cba85555dac703ad6ef6e" and "80343bd9295e33edb41acdab84fe061aa19e1b0f" have entirely different histories.

View File

@ -274,13 +274,9 @@ async function downloadEZPPLauncherUpdateFiles(osuPath, updateFiles) {
//NOTE: delete files that are not in the updateFiles array //NOTE: delete files that are not in the updateFiles array
const foldersToPrune = updateFiles.map(file => path.dirname(path.join(osuPath, ...file.folder.split("/"), file.name))).filter((folder, index, self) => self.indexOf(folder) === index); const foldersToPrune = updateFiles.map(file => path.dirname(path.join(osuPath, ...file.folder.split("/"), file.name))).filter((folder, index, self) => self.indexOf(folder) === index);
for (const pruneFolder of foldersToPrune) { for (const pruneFolder of foldersToPrune) {
//NOTE: check if the folder is not the osu root folder.
if (path.basename(pruneFolder) == "osu!")
continue;
for (const files of await fs.promises.readdir(pruneFolder)) { for (const files of await fs.promises.readdir(pruneFolder)) {
const filePath = path.join(pruneFolder, files); const filePath = path.join(pruneFolder, files);
if (!updateFiles.some(file => path.join(osuPath, ...file.folder.split("/"), file.name) === filePath)) { if (!updateFiles.some(file => path.join(osuPath, ...file.folder.split("/"), file.name) === filePath)) {
await fs.promises.rm(filePath, { recursive: true, force: true }); await fs.promises.rm(filePath, { recursive: true, force: true });
} }
} }