obgnail / typora_plugin

Typora plugin. Feature enhancement tool | Typora 插件,功能增强工具
MIT License
1.35k stars 72 forks source link

aur包 `PKGBUILD` 未添加 `backup` 属性会导致更新后覆盖 `*.user.toml` 配置 #624

Closed XDwanj closed 3 weeks ago

XDwanj commented 4 weeks ago

首先感谢作者对该包做出的一切付出!

你好,我阅读了 PKGBUILD 文件,发现打包脚本中并没有对 /usr/share/typora/resources/plugin/global/settings/*.user.toml 进行备份操作,出处在 ArchWiki该章节 中,这将致使每次包更新的时候覆盖用户对 *.user.toml 的修改。

麻烦可以添加 backup 属性以修正该部分吗?

obgnail commented 3 weeks ago

@XDwanj

你好,感谢反馈。

包主不是我,是 @jeffrey4l 大佬。我没有编辑的权限。(大佬看到这条消息的话麻烦有空的时候处理一下)

绕过方案:将 *.user.toml 迁移到家目录下

你可以在家目录下创建 .config/typora_plugin/ ,并在里面存放配置文件,而且这里的配置文件 优先级最高

dir /b C:\Users\用户名\.config\typora_plugin

custom_plugin.user.toml
hotkey.user.toml
settings.user.toml

此方法适用于 Linux、Windows 平台。

jeffrey4l commented 3 weeks ago

the PKGBUILD is fixed, please check . thanks a lot.

XDwanj commented 3 weeks ago

@jeffrey4l

Thank you for your response. I have updated the package, and it functions splendidly!

XDwanj commented 3 weeks ago

@jeffrey4l

I have meticulously re-evaluated the package and I apologize for my prior hasty conclusion.

The backups entry in the PKGBUILD file should be backup, and its path should not commence with a /.

Below is the revised reference:

1,4d0
< 
< 
< # typora-plugin
< 
24,28c20,24
< backups=(
<     '/usr/share/typora/resources/plugin/global/settings/custom_plugin.user.toml'
<     '/usr/share/typora/resources/plugin/global/settings/hotkey.user.toml'
<     '/usr/share/typora/resources/plugin/global/settings/settings.user.toml'
<     )
---
> backup=(
>     'usr/share/typora/resources/plugin/global/settings/custom_plugin.user.toml'
>     'usr/share/typora/resources/plugin/global/settings/hotkey.user.toml'
>     'usr/share/typora/resources/plugin/global/settings/settings.user.toml'
> )
jeffrey4l commented 3 weeks ago

@XDwanj updated, please check

XDwanj commented 3 weeks ago

@jeffrey4l Thank you for the correction; the backup functionality is now operating flawlessly.

obgnail commented 3 weeks ago

close issue as completed.