Ludeon Forums

Ludeon Forums

  • April 21, 2019, 10:58:55 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Tool/WIP] Duplicate defName checker (mod compatibility checker)  (Read 1649 times)

ItchyFlea

  • Who's a good kitty?
  • Administrator
  • Planetologist
  • *****
  • Posts: 1907
  • Psychotic Squirrel
    • View Profile

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:
Code: [Select]
#!/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.
Logged
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

  • Global Moderator
  • Transcendent
  • ****
  • Posts: 5857
  • Engineer
    • View Profile
Re: [Tool/WIP] Duplicate defName checker (mod compatibility checker)
« Reply #1 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.
Logged
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?