Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
KSP-CKAN/NetKAN#1455 (comment)
This pull request aims to fix that.
Cause
The scenario described above can be generalized to any situation in which two copies of MiniAVC.dll are located in directories which are in an ancestor/descendant relationship. E.g.:
Or even something like:
In those cases, this code will find version files in the nested subfolder multiple times and add them to the list of addons to check:
KSPAddonVersionChecker/MiniAVC/AddonLibrary.cs
Lines 90 to 100 in 0caed8a
Later this results in multiple popups if there are incompatibilities or updates.
Changes
Now we build a temporary
Dictionary
that tracks version files and their associated settings. If we find the same version file more than once, we don't add it multiple times; instead we compare the associated settings files and choose the one that is closest to that version file. Once we've checked all the files, we collapse theDictionary
to a list ofAddons
, as before.This is what I was trying to compile on the mod adoption tutorial thread. I have not been able to get the build working, so there may be syntax errors here; just let me know and I'll fix them.