Better support XDG Base Directory Specification by using $XDG_DATA_HOME - #98
Merged
Merged
Conversation
This fixes a bug in which if BASHER_ROOT is not set and XDG_DATA_HOME is empty before running Basher, '/basher' will be set to BASHER_ROOT
In 'install.sh', Basher is still installed to ~/.basher, but we also check $XDG_DATA_HOME/basher before installing to ensure it does not exist
This sets XDG_DATA_HOME in test_Helper.bash to an empty string so that the tests work if Basher is installed to XDG_DATA_HOME/basher. Without this change, the tester's current XDG_DATA_HOME variable value would bleed into the tests, causing many tests to fail.
pawamoy
reviewed
Jun 11, 2021
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 adds support for using XDG_DATA_HOME
In summary, the value
${XDG_DATA_HOME:-$HOME/.local/share}/basheris set to$BASHER_ROOT, but only if that directory already exists. This ensures backwards compatibility. If the user chooses to use the new XDG_DATA_HOME system, they must move ~/.basher to$XDG_DATA_HOME/basherthemselves. And, theuninstall.shnow script also checks this directory to remove it. Theinstall.shalso checks this directory before installing (to prevent installation if an installation already exists), but does not install Basher to that location. Ensured all tests pass locallyTest Results
Closes #73