Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6e7149873f
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 23 lines (17 sloc) 0.5 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
package xt::Run;
use strict;
use base qw(Exporter);
our @EXPORT = qw(run last_build_log);

use Capture::Tiny qw(capture);
use File::Temp qw(tempdir);

$ENV{PERL_CPANM_HOME} = tempdir(CLEANUP => 1);

sub run {
    my @args = @_;
    my @notest = $ENV{NOTEST} ? ("--notest") : ();
    return capture { system($^X, "./script/cpanm.PL", @notest, "--quiet", "--reinstall", @args) };
}

sub last_build_log {
    open my $log, "<", "$ENV{PERL_CPANM_HOME}/latest-build/build.log";
    join '', <$log>;
}

1;
Something went wrong with that request. Please try again.