add test for nonexistant polygen
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 30 Jul 2006 21:54:03 +0000 (21:54 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 30 Jul 2006 21:54:03 +0000 (21:54 +0000)
IkiWiki/Plugin/polygen.pm

index c148891672ebc54cfc6196b1143d26725c95974e..2ed81c8e46d13ec0d94f1d6d38b73dfdd8cb0573 100644 (file)
@@ -27,6 +27,9 @@ sub preprocess (@) { #{{{
        $symbol =~ s/[^A-Za-z0-9]//g if defined $symbol;
 
        my $grmfile = '/usr/share/polygen/ita/polygen.grm';
+       if (! -d '/usr/share/polygen') {
+               return "[[polygen not installed]]";
+       }
        find({wanted => sub {
                        if (substr($File::Find::name, -length($grammar)) eq $grammar) {
                                $grmfile = IkiWiki::possibly_foolish_untaint($File::Find::name);