Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全局配置文件存储在版本号子文件夹中 #872

Merged
merged 4 commits into from
Apr 3, 2024
Merged

全局配置文件存储在版本号子文件夹中 #872

merged 4 commits into from
Apr 3, 2024

Conversation

Blinue
Copy link
Owner

@Blinue Blinue commented Apr 3, 2024

目前全局配置文件存储在 %LocalAppData%\Magpie\config\config.json,所有版本共用。配置文件向后兼容,而不向前兼容。当混用不同版本(混用正式版和测试版可能比较常见)时会导致旧版本无法正确读取配置文件,并在保存后造成配置项丢失。

这个 PR 将配置文件移动到版本号子文件夹中,比如目前配置文件版本号为 2,存储路径为 %LocalAppData%\Magpie\config\v2\config.json。当找不到配置文件时,将会在旧版本路径依次查找,确保从旧版本迁移配置。迁移完成后配置文件将保存在新路径中,因此和旧版本使用不同的配置文件。

特别处理 v1,它位于 config 根目录。

@Blinue Blinue added the enhancement New feature or request label Apr 3, 2024
@Blinue Blinue merged commit cd7f10b into dev Apr 3, 2024
4 checks passed
@Blinue Blinue deleted the config branch April 3, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant