fix(mango): template support optional source - #4073
Open
rogervn wants to merge 1 commit into
Open
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.
Summary
The template today looks for a mango config with the source for the generated noctalia file with the colors. If that source include is not present, it tries to add it as part of applying the template.
However, in the case that the file is read-only (like home-manager config file) and that the original file already has a source-optional (which will not match the script condition) it will fail as there's no permission to overwrite the home-manager file.
This PR fixes it by applying an optional (-optional) in the regular expression check in case the user prefers to use source-optional. The written line in case there's no source include present stays the same.
Motivation
Users might prefer to use source-optional in configs that don't fail on the first time noctalia is run on that system so there's no noctalia colors file.
Type of Change
Related Issue
None
Testing
In a system with home-manager config isntalled and source-optional present, tried to run the script:
And ran the modified script:
Manual Coverage
Screenshots / Videos
N/A
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.assets/translations/en.json, or this PR adds no new user-facing strings.Additional Notes