Created
December 24, 2013 19:43
-
-
Save kurtroberts/8117132 to your computer and use it in GitHub Desktop.
For when sloppy coders can't keep their case straight. I never believed this possible, but after contracting with a firm who's name I will not mention for a team, I got back about 200 json files with randomly capitalized names. Despite being very clear we were deploying to an apache2 server on Linux, they tested on their case-insensitive Windows…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
opendir DIR, "."; | |
my @files = grep { $_ ne '.' && $_ ne '..' } readdir DIR; | |
closedir DIR; | |
for $file (@files) { | |
my $lfile = lc($file); | |
if ($lfile ne $file) { | |
print $file . "\n"; | |
`svn mv $file $lfile`; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment