Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 484 Bytes
use strict;
use warnings;
use Smart::Comments "###";
use File::Copy qw(cp);
for my $file (@ARGV) {
(print "skip ". $file . "\n" and next) unless $file =~ m{\borigin(?:/|\\)[^/]+(?:/|\\)[^/]+\.new$};
### $file
my $file2 = $file;
$file2 =~ s{\.new$}{.old};
### $file2
cp $file, $file2;
my $file3 = $file2;
$file3 =~ s{\borigin\b}{trans};
### $file3
my $path = $file3;
$path =~ s{(?:/|\\)[^/]+$}{};
mkdir $path;
cp $file, $file3;
}
Jump to Line
Something went wrong with that request. Please try again.