Skip to content

Commit

Permalink
don't explode when no lib folder exists +test
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed May 28, 2013
1 parent d315631 commit 99ecd04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/Panda/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ sub build-order(@module-files) {

method build($where) {
indir $where, {
my @files = find(dir => 'lib', type => 'file').grep({
$_.name.substr(0, 1) ne '.'
});
my @files;
if 'lib'.IO.d {
@files = find(dir => 'lib', type => 'file').grep({
$_.name.substr(0, 1) ne '.'
});
}
if "Build.pm".IO.f {
@*INC.push('.');
require 'Build.pm';
Expand Down
4 changes: 3 additions & 1 deletion t/builder.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use Test;
use Panda::Builder;
use Shell::Command;

plan 6;
plan 7;

my $srcdir = 'testmodules';

Expand All @@ -15,6 +15,8 @@ ok "$srcdir/dummymodule/blib/lib/bar.pir".IO !~~ :f, 'pod not compiled';
ok "$srcdir/dummymodule/blib/lib/foo.js".IO ~~ :f,
'random files also copied to blib';

lives_ok { Panda::Builder.build("$srcdir/testme1") };

rm_rf "$srcdir/dummymodule/blib";

# vim: ft=perl6

0 comments on commit 99ecd04

Please sign in to comment.