Made a quick script to quickly and easily figure out what files I need to include in my mod, and figured I'd share.
Note that this is perl, so to use this you'll need to have perl installed on your machine. If you're running linux (and maybe mac), you'll need to add the standard #!/usr/bin/perl or whatever to the top.
Basically all this does is go through all the files in the modded version, compare them to the base version, and copy the new and changed files to a new location for easy bundling.
### Script to find which files I've modified for Civilization Forge
use File::Compare;
use File::Copy;
my $ModDir = 'C:\Program Files\DF\31.10 CF\raw\objects';
my $BaseDir = 'C:\Program Files\DF\31.10\raw\objects';
my $DestDir = 'C:\Program Files\DF\Civ_Forge_Files';
opendir(DIR, $ModDir);
while ( $filename = readdir(DIR) )
{
$ModFiles{$filename} = 1;
}
closedir(DIR);
opendir(DIR, $BaseDir);
while ( $filename = readdir(DIR) )
{
$BaseFiles{$filename} = 1;
}
closedir(DIR);
foreach $ModFile (sort keys %ModFiles)
{
if ($ModFile eq "." or $ModFile eq "..") { next(); }
my $ModFilePath = $ModDir . "\\$ModFile";
my $BaseFilePath = $BaseDir . "\\$ModFile";
my $NewFilePath = $DestDir . "\\$ModFile";
if (! $BaseFiles{$ModFile})
{
print "$ModFile is new\n";
©($ModFilePath,$NewFilePath) or warn "Cannot copy $ModFilePath to $NewFilePath";
}
else
{
my $Diff = &compare($ModFilePath,$BaseFilePath);
#print " $ModFile -> \"$Diff\"\n";
if ($Diff)
{
print "$ModFile has been altered\n";
©($ModFilePath,$NewFilePath) or warn "Cannot copy $ModFilePath to $NewFilePath";
}
else
{
print "$ModFile has NOT been altered\n";
}
}
}