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.
目前全局配置文件存储在 %LocalAppData%\Magpie\config\config.json,所有版本共用。配置文件向后兼容,而不向前兼容。当混用不同版本(混用正式版和测试版可能比较常见)时会导致旧版本无法正确读取配置文件,并在保存后造成配置项丢失。
这个 PR 将配置文件移动到版本号子文件夹中,比如目前配置文件版本号为 2,存储路径为 %LocalAppData%\Magpie\config\v2\config.json。当找不到配置文件时,将会在旧版本路径依次查找,确保从旧版本迁移配置。迁移完成后配置文件将保存在新路径中,因此和旧版本使用不同的配置文件。
特别处理 v1,它位于 config 根目录。