-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added '.NET Transactional File Manager' support, removed our implementation #166
Added '.NET Transactional File Manager' support, removed our implementation #166
Conversation
} | ||
else | ||
{ | ||
contents.AddRange(FindAllFiles(zipfile)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh, we already have a method for doing this. GenerateDefaultInstall()
. It's not the same as all the files in the archive; instead, we look for the top-most directory that has the same name as the module identifier, and install that.
This is really my fault for not factoring out all the code into something which lets you supply a module and a zipfile, and get back the files which would be installed. (That was kinda what FindInstallableFiles()
was meant to do, but it existed before we had default installs).
I'll be sending you a PR on your PR, but it should be a pretty straightforward one. :)
- Add
FindInstallableFiles(Module, Zipfile)
or analogue thereof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a terrible person, I didn't write something that gives back all the installable files from a Module and its Zipfile. I did patch it so it doesn't need FindAllFiles, and does match what would be installed. I also added a TODO. :)
The sheer number of lines of code deleted in this PR fills me with joy. Thank you. <3 |
@AlexanderDzhoganov , I've opened #171 and I'm closing this PR. #171 includes all of your changes, but has my own tweaks on top (which are relatively minor). |
- Now a static method, for easier testing and less coupling. - Has many method signatures. Can find files from module or stanza, zipfile or filename. - Improved GetModuleContentsList() to use new FindInstallableFiles() TODO: Still refactor everything use to use FindInstallableFiles() (eg: Install()). For KSP-CKAN#90, relates to KSP-CKAN#166 (which is contained by KSP-CKAN#171).
- Now a static method, for easier testing and less coupling. - Has many method signatures. Can find files from module or stanza, zipfile or filename. - Improved GetModuleContentsList() to use new FindInstallableFiles() TODO: Still refactor everything use to use FindInstallableFiles() (eg: Install()). For KSP-CKAN#90, relates to KSP-CKAN#166 (which is contained by KSP-CKAN#171).
Closes #161