Skip to content

Commit

Permalink
some vita copying improvements [...]
Browse files Browse the repository at this point in the history
- create vita dir if it doesn't exist
- actually delete unknown files automatically
- go ding ding ding when done
  • Loading branch information
wchristian committed Jan 7, 2019
1 parent 29a054f commit 87d793b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _build_translation_patch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sub run {
}

sub try_copy {
print "ready to copy? [y]";
print "WARNING: This will delete all unknown files in ux0:/rePatch/PCSG00684/Media, backup if you have anything there.\nReady to copy? [y]";
my $in .= <>; # i have no idea why i need to do this twice
$in .= <>;
$in =~ s/[\r\n]//g;
Expand Down
10 changes: 9 additions & 1 deletion vita_copy.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ sub run {
my $vita_dir = "e:/rePatch/PCSG00684/Media";
my $cand_dir = "../kc_translation_mod_candidate/rePatch/PCSG00684";

io($vita_dir)->mkpath;
my @vita_files = grep !/checksums/, io($vita_dir)->All_Files;
for my $file (@vita_files) {
my @file_parts = split /\/|\\/, $file;
shift @file_parts for 1 .. 3;
my $cand_file = join "/", $cand_dir, @file_parts;
next if -e $cand_file;
say "file '$file' on vita doesn't exist in candidate dir, recommend delete";
say "file '$file' on vita doesn't exist in candidate dir, deleting";
unlink $file;
}

my $sums_file = "$vita_dir/checksums";
Expand Down Expand Up @@ -52,5 +54,11 @@ sub run {
io($sums_file)->print( join "\n", map "$_\t$sums{$_}", sort keys %sums );

say "done";
$|++;
print "\7";
sleep 1;
print "\7";
sleep 1;
print "\7";
return;
}

0 comments on commit 87d793b

Please sign in to comment.