lilydjwg / nvchecker

New version checker for software releases
MIT License
425 stars 68 forks source link

feat(core): resolve symlinks on file write #233

Closed anthraxx closed 10 months ago

anthraxx commented 1 year ago

Instead of using the passed filename as the rename target, use Path.resolve for resolving any symlinks.

This allows to use symlinks for the nvchecker database files that point somewhere else. Before this commit nvchecker simply replaced the symlink with an actual file, now we resolve the targets first and only replace the actual file that is pointed to.

anthraxx commented 1 year ago

CC @Segaja

lilydjwg commented 1 year ago

The tmp file needs to be created in the same directory of target in order to have better chance of a successful rename.