lemonldap-ng/scripts/minifierjs
2012-02-28 22:48:20 +00:00

22 lines
400 B
Perl
Executable File

#!/usr/bin/perl -Iscripts
use JavaScript::Minifier 'minify';
foreach my $f (@ARGV) {
unless(-e $f) {
print STDERR "$f doesn't exists, skipping\n";
next;
}
unless(-w $f) {
print STDERR "$f is not writeable, skipping\n";
next;
}
my $s='';
open F, $f;
$s = minify(input => *F);
close F;
open F, ">$f";
print F $s;
close F;
}