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: trim whitespace from global filepath #23

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

tesselslate
Copy link
Contributor

On POSIX systems, text files are supposed to end with line breaks. Many text editors will uphold this rule and place a newline at the end of the standardsettings.global file. This prevents StandardSettings from loading the global JSON file, since it thinks the filepath ends with a line break when it shouldn't.

It might be better to read only the first line from the file or only remove trailing \r and \n characters? Feel free to let me know if you'd prefer this was implemented in a different way.

On POSIX systems, files are supposed to end with line breaks. Many text
editors will uphold this rule and place a newline at the end of the
standardsettings.global file, which prevents it from being loaded
because the filepath should not end with a newline.
Copy link
Owner

@KingContaria KingContaria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, files ending in whitespaces aren't really supported (atleast on windows) anyway so trimming seems reasonable

@KingContaria KingContaria merged commit 3ba73f3 into KingContaria:1.16.1 Oct 21, 2024
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.

2 participants