Repository navigation
YOU-43: Create and maintain the config file once per plugin version - #39
Merged
Merged
Conversation
A SessionStart hook creates ~/.config/youtrack-task/config.toml from config.example.toml, appends options added by an update (commented out) and removes options the plugin dropped, judged against a snapshot of the previous example. The work runs once per plugin version, so normal sessions are unaffected.
read-config ignores everything from the first active table header on, so an option appended after it would stop working once uncommented. Top-level options are now inserted before that header.
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.
YouTrack: https://youtrack.xn--wrm-hoa.li/issue/YOU-43
A
SessionStarthook now creates~/.config/youtrack-task/config.tomlfromconfig.example.tomland keeps it in step with the plugin, once per plugin version.[table]header, so they still work when uncommented. Options the example no longer has are removed, judged against a snapshot of the previous example; the user's own keys, values and comments are never touched.config.toml.bakis written before any change, and one line tells the user what was created, added or removed.read-configstays read-only. If the config directory is not writable, the hook warns and retries next session.Commits:
Version bumped to 0.21.0 (changelog, spec, docs and manual test rows updated).
Test plan:
bash tests/sync-config.shand the othertests/*.shsuites pass;shellcheck -S warning hooks/sync-configis clean.tests/README.mdrows 126-128 (fresh install, update with added and removed options, read-only config dir).