#!/usr/bin/perl use strict; use lib '../../adiary/lib'; use Satsuki::Base; #------------------------------------------------------------------------------ my $check_dir = '__cr_only/'; my $r = Satsuki::Base->new(); my $themas = $r->search_files($check_dir, undef, 1); #------------------------------------------------------------------------------ # ÊÑ´¹ºî¶È #------------------------------------------------------------------------------ foreach my $theme (@$themas) { my $dir = $check_dir . $theme . '/'; if (!-d $dir) { next; } my $css_file = $dir . $theme . '.css'; print "Read $css_file\n"; my $lines = $r->fread_lines($css_file); if ($#$lines == 0) { $lines = &cr2lf($lines->[0]); $r->fwrite_lines($css_file, $lines); } else { print "Not need?\n"; } my $readme_file = $dir . 'README'; print "Read $readme_file\n"; my $lines = $r->fread_lines($readme_file); if ($#$lines > 0) { print "Not need?\n"; next; } $lines = &cr2lf($lines->[0]); $r->fwrite_lines($readme_file, $lines); } sub cr2lf { my ($line) = @_; my @lines = split("\r", $line); foreach(@lines) { $_ .= "\n"; } return \@lines; }