Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add logic to build_epub and build_pdf to create target directories.

A new user coming cloning the project is going to be quite surprised to
find that the instructions fail because these directories don't exist.
  • Loading branch information...
commit f8457133ddc2fb8e7b147871619b6b8f36424526 1 parent 5be0fb4
@cpanelWade cpanelWade authored
Showing with 4 additions and 0 deletions.
  1. +2 −0  build/tools/build_epub.pl
  2. +2 −0  build/tools/build_pdf.pl
View
2  build/tools/build_epub.pl
@@ -11,6 +11,7 @@
use Pod::PseudoPod::HTML;
use File::Spec::Functions qw( catfile catdir splitpath );
+use File::Path qw( mkpath );
use EBook::EPUB;
use HTML::Entities;
@@ -175,6 +176,7 @@ sub get_output_fh
my $chapter = shift;
my $name = (splitpath $chapter )[-1];
my $xhtmldir = catdir(qw( build xhtml ));
+ mkpath( $xhtmldir ) unless -d $xhtmldir;
$name =~ s/\.pod/\.xhtml/;
$name = catfile($xhtmldir, $name);
View
2  build/tools/build_pdf.pl
@@ -4,6 +4,7 @@
use warnings;
use File::Spec::Functions qw( catfile catdir splitpath );
+use File::Path qw( mkpath );
# getting chapter list
my @chapters = get_chapter_list();
@@ -13,6 +14,7 @@
or die "pod2pdf is not present in your PATH; please install App::pod2pdf\n";
my $outpath = catdir( qw( build pdf ) );
+mkpath( $outpath ) unless -d $outpath;
for my $chapter ( @chapters ){
my @filename = split( /\./ , $chapter );
Please sign in to comment.
Something went wrong with that request. Please try again.