Ludeon Forums

RimWorld => Mods => Tools => Topic started by: ItchyFlea on October 30, 2014, 07:47:28 PM

Title: [Tool/WIP] Duplicate defName checker (mod compatibility checker)
Post by: ItchyFlea on October 30, 2014, 07:47:28 PM
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.
Title: Re: [Tool/WIP] Duplicate defName checker (mod compatibility checker)
Post by: skullywag on October 30, 2014, 08:30:14 PM
If people prefix their defs this could be somewhat avoided. (Am updating all mine as we speak) Cool little script none the less.