Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mods not loaded on Linux/macOS if their path has trailing whitespace #958

Closed
wants to merge 2 commits into from

Conversation

jakerosado
Copy link
Contributor

Resolves #905

@Pathoschild
Copy link
Owner

Thanks for the PR!

Unfortunately I see a few issues with this approach:

  • This also allows leading whitespace, which won't work on any OS so far as I know.
  • Path normalization is often used for user input (e.g. from content packs) and before path concatenation, where surrounding whitespace is virtually never intended and can cause errors.
  • This would let mod authors on Linux/macOS accidentally create a mod which can't work on Windows.

I think it'd be better to go in the other direction. To help mods work consistently on all platforms, SMAPI could explicitly validate that there are no mod folder paths with trailing whitespace and show a friendly error message explaining how to fix it.

@Pathoschild Pathoschild changed the title Fix trailing space mod load Fix mods not loaded on Linux/macOS if their path has trailing whitespace Jul 7, 2024
@jakerosado
Copy link
Contributor Author

To my surprise, I found leading and trailing whitespaces allowed on my Linux partition. It's not something I ever considered trying prior to seeing this issue.

Ultimately, I think you're right. While I'm sure there's some underlying reason for wanting these kinds of whitespaces on *nix systems in certain circumstances, I don't see any direct relevance for wanting to encourage it in SMAPI. I'll revert the commit and come up with an error message instead.

@Pathoschild
Copy link
Owner

I'll close this, but feel free to submit a new PR for the suggested change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trailing spaces in directory names in Mac/Linux causes mods to fail to load.
2 participants