Barleytree / Dupery

A mod for Oxygen Not Included.
https://steamcommunity.com/sharedfiles/filedetails/?id=2679326313
MIT License
5 stars 3 forks source link

Fix for case-sensitive file systems (Linux) #12

Closed P33ry closed 1 year ago

P33ry commented 1 year ago

Motivation

This is a solution to issue #9.

I've tried to get Dupery to run with the example mod Print Cassady on Linux.

It turns out that due to the personalities.json not being called PERSONALITIES.json Dupery doesn't detect it when running on systems with case-sensitive file systems (for example Linux) where such things do make a difference.

While the problem comes from mods not naming their PERSONALITIES.json correctly, I find this issue to be more easily fixed in Dupery. Otherwise every mod maker with that issues would have to change their file name without it making issues to most (windows) users.

Changes

If the PERSONALITIES.json is not found as usual, instead of giving up, a search with a case-insensitive regex is started in the top-level of the mod folder.

The first match is then used as the expected PERSONALITIES.json

Testing

I've tested this by creating new games in ONI and checking that Cassidy appears in-game as well as in the Player.log.

This change works for me on Linux and Windows without issue and fixes issue #9.

Barleytree commented 1 year ago

Look good to me, thanks for the contribution! I'll roll it into the next update.