Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added target dir validation to build scripts

  • Loading branch information...
commit b9bc8f79395e2a3a4221a91ff67229e6f568f079 1 parent 156c23d
@nyamned nyamned authored
View
1  build/pdf/.gitignore
@@ -0,0 +1 @@
+!.gitignore
View
3  build/tools/build_epub.pl
@@ -9,6 +9,7 @@
use strict;
use warnings;
+use File::Path 'mkpath';
use Pod::PseudoPod::HTML;
use File::Spec::Functions qw( catfile catdir splitpath );
use EBook::EPUB;
@@ -282,7 +283,7 @@ sub generate_ebook
# Make the directory if it doesn't exist.
my $dir = catdir(qw(build epub));
- mkdir $dir unless -e $dir;
+ mkpath $dir unless -e $dir;
# Generate the ePub eBook.
my $filename = catfile(qw(build epub little_plack_book.epub));
View
2  build/tools/build_html.pl
@@ -3,6 +3,7 @@
use strict;
use warnings;
+use File::Path 'mkpath';
use Pod::PseudoPod::HTML;
use File::Spec::Functions qw( catfile catdir splitpath );
@@ -80,6 +81,7 @@ sub get_output_fh
my $chapter = shift;
my $name = ( splitpath $chapter )[-1];
my $htmldir = catdir( qw( build html ) );
+ mkpath $htmldir unless -e $htmldir;
$name =~ s/\.pod/\.html/;
$name = catfile( $htmldir, $name );
View
2  build/tools/build_pdf.pl
@@ -3,6 +3,7 @@
use strict;
use warnings;
+use File::Path 'mkpath';
use File::Spec::Functions qw( catfile catdir splitpath );
# getting 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 -e $outpath;
for my $chapter ( @chapters ){
my @filename = split( /\./ , $chapter );
Please sign in to comment.
Something went wrong with that request. Please try again.