Skip to content

Commit

Permalink
Added Tilde to Disabled Melon Folder Check
Browse files Browse the repository at this point in the history
  • Loading branch information
HerpDerpinstine committed Oct 15, 2024
1 parent f010301 commit f932262
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions MelonLoader/Melons/MelonFolderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,21 @@ private static void LoadFolder<T>(string path,
}
}

private static bool StartsOrEndsWith(string dirNameLower, string target)
=> dirNameLower.StartsWith(target)
|| dirNameLower.EndsWith(target);

private static bool IsUserLibsFolder(string dirNameLower)
=> dirNameLower.StartsWith("userlibs")
|| dirNameLower.EndsWith("userlibs");
=> StartsOrEndsWith(dirNameLower, "userlibs");

private static bool IsDisabledFolder(string path,
out string dirNameLower)
{
string dirName = new DirectoryInfo(path).Name;
dirNameLower = dirName.ToLowerInvariant();
return dirNameLower.StartsWith("disabled")
|| dirNameLower.EndsWith("disabled")
|| dirNameLower.StartsWith("old")
|| dirNameLower.EndsWith("old");
return StartsOrEndsWith(dirNameLower, "disabled")
|| StartsOrEndsWith(dirNameLower, "old")
|| StartsOrEndsWith(dirNameLower, "~");
}

private static void ProcessFolder<T>(string path,
Expand Down

0 comments on commit f932262

Please sign in to comment.