atlanticaccent / starsector-mod-manager-rust

A mod manager for Starsector, a space fleet-battle and economics simulator. This time written in Rust.
https://atlanticaccent.github.io/starsector-mod-manager-rust/
MIT License
33 stars 1 forks source link

Installing to a different partition/drive does not delete intermediate folder #89

Open atlanticaccent opened 2 years ago

atlanticaccent commented 2 years ago

When installing a mod we attempt to just rename (aka: what a move really is) the source folder or intermediate unpacked archive folder to the destination mod directory. This typically doesn't work across partitions/drives and returns an error - when that happens we assume the error is because of the drive issue and attempt a recursive copy (rust doesn't return a good error code for this). When this fallback occurs we don't delete the source folder - this isn't an issue when installing an archive because the intermediate folder should be cleaned up by the system automatically because of temp-dir (hopefully). This isn't the case when installing from a folder though.

Whether this should be outright fixed (ie: always delete source) or turned into a feature (toggle delete source in settings) is debatable.