X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fmasonize;h=3139e0af50e1f04ea095a0177a5dd6357b056fce;hp=475c9a6bf019d1f33ba61f020f08fcb604d01648;hb=e520b9f7d88539634225560d462d03c7d2057d9d;hpb=0ebeec96313dd7edfca340f01f8fbbbac1f4aa1d diff --git a/bin/masonize b/bin/masonize index 475c9a6bf..3139e0af5 100755 --- a/bin/masonize +++ b/bin/masonize @@ -1,6 +1,7 @@ #!/usr/bin/perl -foreach $file ( split(/\n/, `find . -depth -print | grep cgi\$`) ) { +foreach $file ( split(/\n/, `find . -depth -print`) ) { + next unless $file =~ /(cgi|html)$/; open(F,$file) or die "can't open $file for reading: $!"; @file = ; #print "$file ". scalar(@file). "\n"; @@ -8,6 +9,7 @@ foreach $file ( split(/\n/, `find . -depth -print | grep cgi\$`) ) { system("chmod u+w $file"); open(W,">$file") or die "can't open $file for writing: $!"; select W; $| = 1; select STDOUT; + $newline = ''; #avoid prepending extraneous newlines $all = join('',@file); $mode = 'html'; @@ -26,7 +28,7 @@ foreach $file ( split(/\n/, `find . -depth -print | grep cgi\$`) ) { #die; next; } elsif ( $all =~ /^<%(.*)$/s ) { - print W "\n"; + print W $newline; $newline = "\n"; $all = $1; $mode = 'perlc'; next;