[Tool/WIP] Duplicate defName checker (mod compatibility checker)

Started by ItchyFlea, October 30, 2014, 07:47:28 PM

Previous topic - Next topic

ItchyFlea

I'm doing an online course about Linux and got to a part where they explain bash scripts.
Considering all the past stuff I've learned during this course, I realised that it'd be possible to write a short script that could compare 2 or mores mods against each other and see if they might conflict with each other.

This is the contents of the script file:
#!/bin/bash
rm dupes.txt
grep -h -r "<defName>" Test/* >> checkresults.txt
sed -i -e 's/^[ \t]*//' -e 's/[ \t]*$//' checkresults.txt
sort checkresults.txt > results.txt
uniq -c -d results.txt > dupes.txt
rm checkresults.txt
rm results.txt


It's not 100% accurate given how defNames can end up duplicated within a single mod, so it needs some work in the regard. Because I don't have linux at home, I won't be able to work on this further. If anybody wishes to expand this and make it more useful (or even cross-platform) feel free to do so.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

skullywag

If people prefix their defs this could be somewhat avoided. (Am updating all mine as we speak) Cool little script none the less.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?