wow-addon-updater
wow-addon-updater copied to clipboard
Addons should always copy to a clean destination directory
In the situation where an addon has files A, B, C
in version 1, then in version 2, it has filed B, C, D
, then A
will sit on the filesystem forever alone. The copy operation from zip.extract()
will recursively overwrite any files with conflicts, but does not wipe the destination directory clean beforehand.
Checking that the path that gets deleted is in the chosen directory for addons is probaly a good idea. We could do this by getting the os.path.realpath on the addon path and making sure that its starts with addon location. Just to avoid deleting folders outside the addon directory.
The code which I thought closed this forgot about addons with many top-level folders. In that case, until a refactor can be done for the extraction code, this will stay open.