forked from BASLQC/kc-vita-translation
-
Notifications
You must be signed in to change notification settings - Fork 3
/
copy_unmodded_files.pl
30 lines (28 loc) · 917 Bytes
/
copy_unmodded_files.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use 5.020;
use strictures 2;
use IO::All -binary;
use Capture::Tiny 'capture';
$|++;
run();
sub run {
say "copying translated unmodded files";
for my $set ( #
[ "png", "en/sce_sys", "sce_sys/" ],
[ "png", "en/sce_sys/livearea/contents", "sce_sys/livearea/contents/" ],
)
{
my ( $ext, $src, $tgt ) = $set->@*;
if(!-d $src) {
warn "$src doesn't exist\n";
next;
}
my @files = grep /\.$ext$/, io($src)->all_files;
for my $file (@files) {
die "didn't find file '$file' in original game" if !-e "../kc_original/repatch/PCSG00684/$tgt" . $file->filename;
my $target_file = "../kc_original_unpack_modded/repatch/PCSG00684/$tgt" . $file->filename;
io( io->file($target_file)->filepath )->mkpath;
$file->copy($target_file);
}
}
say "done";
}