Add Theme.apply_changes() for any theme changes #34
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.
NOTE: This is based on the ideas discussed in #9 to implement a
migration path to fix issues in the theme definitions of existing themes.
It implements:
#23 added name validation for new themes. This change is for migrating
the existing themes. This change doesn't add the
changes
repo field asdiscussed in #9 but prepares for the structure to implement it.
This introduces a public method
apply_changes()
on the Theme typeto apply various changes to an existing theme. The theme changes
field will be added later in the Theme struct. This is a preparation
for the theme changes feature.
The first type of change implemented here is the directory rename
change as
Theme::apply_change_rename_dir()
. It takes an old theme nameand a new theme name and renames the theme directory if found. This is
called by
Theme.apply_changes()
when the theme name is not the sameafter applying the rename change.
Theme.get_name()
returns the effectual name of the theme afterapplying any rename change. The implementation will change once the
changes fields are added in Theme struct.