]> granicus.if.org Git - pgbadger/commitdiff
Do not fail if pod2markdown is not installed
authorGilles Darold <gilles@darold.net>
Sat, 14 Sep 2019 13:47:42 +0000 (15:47 +0200)
committerGilles Darold <gilles@darold.net>
Sat, 14 Sep 2019 13:47:42 +0000 (15:47 +0200)
Makefile.PL

index 313730c0749c6ff6ea00792f85013798e857704b..38c1e3409812b66485e84fe4c54616297443ac12 100644 (file)
@@ -37,12 +37,16 @@ if ($ExtUtils::MakeMaker::VERSION >= 6.46) {
 
 sub MY::postamble {
     return <<'EOMAKE';
+USE_MARKDOWN=$(shell which pod2markdown)
+
 README: doc/pgBadger.pod
        pod2text $^ > $@
+ifneq ("$(USE_MARKDOWN)", "")
        cat doc/pgBadger.pod | grep "=head1 " | sed 's/^=head1 \(.*\)/- [\1](#\1)/' | sed 's/ /-/g' | sed 's/--/- /' > $@.md
        sed -i '1s/^/### TABLE OF CONTENTS\n\n/' $@.md
        echo >> $@.md
        pod2markdown $^ | sed 's/^# /### /' >> $@.md
+endif
 
 .INTERMEDIATE: doc/synopsis.pod
 doc/synopsis.pod: Makefile pgbadger