In RTDB, create app data directory if it doesn't exist. Modify AppDataDir to create the whole path if needed. #992
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.
Description
On Linux, if the XDG_DATA_HOME directory doesn't exist, RTDB disk persistence will fail to initialize. This fixes ensures that if the directory doesn't exist, the app will create it. (Fix for #913.)
Previously, only the last part of the path would be created; but if the user did not have a
.local/share
directory this would still silently fail. This change modifies the behavior to create any missing components from the full app data path.Testing
Manually run integration test on Linux with $XDG_DATA_HOME set to an arbitrary directory. Confirmed that directory was created and used for RTDB persistence:
While tests were running, in another shell:
Also tested with XDG_DATA_HOME set to an absolute path, e.g.
$(pwd)/hello/world
and/tmp/test/directory
.Type of Change
Place an
x
the applicable box:Notes
Release Notes
section ofrelease_build_files/readme.md
.