comparison bin/ren @ 134:cf328bd06078

Special check for windows. What the hell.
author edogawaconan <edho@myconan.net>
date Mon, 31 Oct 2011 11:54:49 +0700
parents 2c94b1e14592
children f963d52c031a
comparison
equal deleted inserted replaced
131:2c94b1e14592 134:cf328bd06078
458 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; 458 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/;
459 $newname =~ s/^\[([&!\.\s\w\- ]+)\] (Air Master|Crystal Blaze|Fairy Tail|Yawara|Ultraviolet Code 044|Gintama|Prince of Tennis|Lupin III S2|Kyou Kara Maou|Bleach|Naruto|One Piece|Detective Conan) - (Ending \d+|Opening \d+|Special \d+|\d+|\d+-\d+) /$2 - $3 [$1]/; 459 $newname =~ s/^\[([&!\.\s\w\- ]+)\] (Air Master|Crystal Blaze|Fairy Tail|Yawara|Ultraviolet Code 044|Gintama|Prince of Tennis|Lupin III S2|Kyou Kara Maou|Bleach|Naruto|One Piece|Detective Conan) - (Ending \d+|Opening \d+|Special \d+|\d+|\d+-\d+) /$2 - $3 [$1]/;
460 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; 460 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /;
461 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /; 461 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /;
462 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; 462 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /;
463 if ($^O eq "MSWin32") { $newname =~ s/ *\\ */\\/g; }
463 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; 464 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname;
464 if ($_ eq $newname) { 465 if ($_ eq $newname) {
465 print("$_: no need to rename, skipping\n"); 466 print("$_: no need to rename, skipping\n");
466 } else { 467 } else {
467 if($skip==1) { print("Result: $_ --> $newname\n"); } 468 if($skip==1) { print("Result: $_ --> $newname\n"); }