fix: make sure config_path option for installs updates correct config #590
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.
Fixes an issue with the config_path option on installs (NOTE: this only affected the new config_path feature added last PR and not anything else). This was meant to be committed as part of the last PR but I had stashed these changes temporarily while testing a slightly different implementation and then forgot to re-apply the stashed changes afterwards (I apologize for this).
The original intention was that when you provided a config_path to the
parse_rocks_toml
function, it would add the import to the base config and then provide you a wrapper object which wrapped both the base config and the newly created import config so that you could write both at once when done updating. The issue with this is that the goal of the config_path option is so that you could make changes ONLY to the specified config file but since I was providing a wrapped object, it meant that despite the imported config having preference, it could end up preferring the base config for writing if the nested table paths didn't exist in the import config (hence defeating the purpose of this feature). I realized this and changed it locally to asynchronously write the base config when the imports have been updated and only return the rocks_toml for the specified config_path so that all modifications would be guaranteed to be only done on the config_path but this was not committed unfortunately.