It just breaks the rules set up by weidu how things should be.
I've been playing a bit with the thought of caching the output of the last extraction and look for tp2-files.
That could help to find the correct placement.
I tried to come up with a way to guess the correct folder, extracted all mods as they are per default, but it's not working 100% as I'd like it to.
Some mods have backup-folders that don't exist, so that does not work all the time.
I've tried to look for AUTO_TRA and line that contain ~somekindof.tra~ and mixed it up with the backup search, so I could guess that right.
Guessing by WeiDU-commands did work partly but there are variables and commands that work and subfolders or some stuff coming from other folders, so that's bad to use.
After spending a few hours of playing with the tp2s and WeiDU, I was a bit fed up and left it as it was.
You could also look if the tp2 is missing, check if download was hosted by gitup, replace the filename and then just repeat the search, but I don't like the idea.
Edit:
So from a logical standpoint, the best thing to do would be:
cache the output of 7zip
look for the tp2-file
If it's there
- parse it. I ended up with the path from ~some.tra~, if that's not there auto_tra and if that's not there backup-folders.
- look if that path is there
- report the mod a faulty if it's missing
If tp is not found
- go through the cached output
- if a tp2-file is there, parse it
- look if the path matches the location and move the folder from the sub-folder it is in. If it does not match, think about renaming.
The best way would be to have modders create a bla-master - folder on github and put the mods bla-folder into that - if that's how github would work.
Edit2:
If the behaviour of github would be append the branch to the real/original name and to downloads name / url, you could get the download-url, check if it's from github, extract the branch, look if the folder named %modname%-%branch% exists and then rename the folder. Then check if the tp2 exists now, else revert the name back. That could be done without much rewriting. Can you verify that?
Edited by dabus, 03 January 2015 - 09:54 AM.