syncthingtray: fix config persist
All changes look good.
Wait for review from human collaborators.
syncthingtray
- [x] Description
- [x] License
- [x] Hashes
- [x] Checkver
- [x] Autoupdate
I think what's preferable is making a symlink. The below part could be put into pre_install:
"$config = \"syncthingtray.ini\"",
"if (!(Test-Path \"$persist_dir\\$config\")) { New-Item \"$persist_dir\\$config\" -ItemType File | Out-Null }",
"New-Item -Type SymbolicLink -Value $persist_dir\\$config -Path $dir\\$config | Out-Null"
You could then remove the post_install and pre_uninstall parts. I also don't think the "ensure" things are necessary (in that case).
Yes, I tested the symlink, and it works correctly. It does not delete the symlink; it deletes the target file and recreates it in the target location. ensure is still necessary, or an error might occur.
But symlink need administrator privilege
Does persist not require admin privilege? I have not tested without.
hard link and junction: normal user symlink: admin or enable developer mode
https://github.com/ScoopInstaller/Scoop/blob/859d1db51bcc840903d5280567846ae2f7207ca2/lib/diagnostic.ps1#L59
ok thanks
/verify
All changes look good.
Wait for review from human collaborators.
syncthingtray
- [x] Description
- [x] License
- [x] Hashes
- [x] Checkver
- [x] Autoupdate