fix: use path.get_base_dir() instead of manual split + join#523
Open
Svitkona wants to merge 1 commit into
Open
fix: use path.get_base_dir() instead of manual split + join#523Svitkona wants to merge 1 commit into
Svitkona wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes an issue with the profile path resolution in the
savefunction that causes InputPlumber profiles to be saved at the wrong path.The way the path resolution works right now is as follows:
user://orres://paths are globalized, the result is split into an array by"/", the last value is popped off, then the remaining parts are joined using"/". The problem is that this strips off the leading/, which turns the result into a relative path. On some setups (especially immutable distros where the path is not writable), this causes errors at runtime when OpenGamepadUI tries to save the profiles:This PR fixes the issue by using the built-in
path.get_base_dirto resolve the base path.A side effect of this PR is that gamepad profiles may need to be regenerated, since they would be placed at a different path.