X-Git-Url: http://git.refcnt.org/?p=colorize.git;a=blobdiff_plain;f=readme.pl;fp=readme.pl;h=877364b381ec18582bd6fbc88d1b9408c29029f7;hp=0000000000000000000000000000000000000000;hb=2c16a073d55ad7f910a8ddaec441fa9bf0b50415;hpb=048936d2b0358ba184b5380751744b8516fd74d1 diff --git a/readme.pl b/readme.pl new file mode 100755 index 0000000..877364b --- /dev/null +++ b/readme.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my $readme = 'README'; +my $readme_cgit = 'README.cgit'; + +die "$0: $readme does not exist\n" unless -e $readme; + +open(my $fh, '<', $readme) or die "Cannot open $readme for reading: $!\n"; +my $text = do { local $/; <$fh> }; +close($fh); + +$text = do { + local $_ = $text; + s//>/g; + $_ +}; + +print "Writing $readme_cgit\n"; + +open($fh, '>', $readme_cgit) or die "Cannot open $readme_cgit for writing: $!\n"; +print {$fh} <<"CGIT"; +
+$text
+
+CGIT +close($fh);