22 lines
400 B
Perl
Executable File
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;
|
|
}
|