GandaG / pyfomod

A high-level fomod library written in Python.
https://pyfomod.rtfd.io/
Apache License 2.0
7 stars 6 forks source link

Fix installer's handling of duplicate directory paths #17

Open krateng opened 1 year ago

krateng commented 1 year ago

Fixes #15

Instead of having a separate priority_dict, this now sorts all files to be installed into an OrderedDict which doesn't overwrite based on the destination path, but simply provides the correct order to copy paths so that higher priority files overwrite lower priority files while directories can get merged (depending on which tool is used to copy).

This introduces a slight inefficiency insofar as duplicate files will get returned twice and, without further parsing, might be copied over each other, but the installer cannot know for certain if a path is a file or a folder.