Floogen / Stardrop

Stardrop is an open-source, cross-platform mod manager for the game Stardew Valley.
https://floogen.gitbook.io/stardrop/
GNU General Public License v3.0
114 stars 31 forks source link

Match `Manifest.json` files as well #144

Closed Adda0 closed 8 months ago

Adda0 commented 8 months ago

This PR fixes once place in the code where variations of manifest.json, namely Manifest.json, are not considered, resulting in omission of some mods from the mod list.

Tested on Linux, not tested on Windows or MacOS.

Example mod with Manifest.json for testing purposes.

Floogen commented 8 months ago

The path parameter for Directory.EnumerateFiles is case-insensitive, per Microsoft's documentation.

Are you seeing behavior that shows otherwise?

Adda0 commented 8 months ago

Interesting, since I do see a different behaviour on Linux. With this option enabled, I can see more mods in the mod list, the linked mod, for example. In my mod folder, this fix shows about 17 more mods in 2845 installed mods in total.

Is it possible that there is an inconsistency between Windows and Linux?

Adda0 commented 8 months ago

Although, I see that the case-insensitive path is only the path to the directory, not necessarily the file name: Enumeratefiles(String, String) in Microsoft documentation:

searchPattern
    [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-7.0) 

The search string to match against the names of files in path. This parameter can contain a combination of valid **literal** path and wildcard (* and ?) characters, but it doesn't support regular expressions.
Floogen commented 8 months ago

Seems like we both are looking at the wrong method, as I had mistakenly linked Directory.EnumerateFiles instead of DirectoryInfo.EnumerateFiles. The latter does not mention case-sensitivity, though I am still not able to replicate the issue on my Windows system.

I will boot up my Linux environment shortly to double check and will merge this over once I can confirm it.

Floogen commented 8 months ago

Merged!

Thank you for your patience as we worked through this. It is always fun when issues occur due to OS differences!

Adda0 commented 8 months ago

I am not sure if "fun" is the word I would use, though. Trying to work out the differences between different OSes is a never-ending story of pain and suffering, from my experience :slightly_smiling_face: I am glad we figured this one out.