Skip to content

Commit

Permalink
Show more cpanm context
Browse files Browse the repository at this point in the history
  • Loading branch information
kentfredric committed Nov 29, 2013
1 parent 8834633 commit 652d691
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/tools.pm
Expand Up @@ -53,9 +53,11 @@ sub safe_exec {

sub cpanm {
my (@params) = @_;
my $cpanm_lines = 4000;
my $exit_code = safe_exec_nonfatal( 'cpanm', @params );
if ( $exit_code != 0 ) {
safe_exec( 'tail', '-n', '200', '/home/travis/.cpanm/build.log' );
diag("\e[32m cpanm \e[0m failed, showing last \e[31m$cpanm_lines\e[0m lines");
safe_exec( 'tail', '-n', $cpanm_lines, '/home/travis/.cpanm/build.log' );
exit $exit_code;
}
return 1;
Expand Down
4 changes: 2 additions & 2 deletions report_fail_ctx.pl
Expand Up @@ -8,6 +8,6 @@
use lib "$FindBin::Bin/lib";
use tools;

diag("\e[31mLast 1000 lines of cpanm build log\e[0m");
safe_exec( 'tail', '-n', '1000', $ENV{HOME} . '/.cpanm/build.log' );
diag("\e[31mLast 4000 lines of cpanm build log\e[0m");
safe_exec( 'tail', '-n', '4000', $ENV{HOME} . '/.cpanm/build.log' );

0 comments on commit 652d691

Please sign in to comment.