forked from lix-project/hydra
Add a convenient way to get logs of a path/drv. Requested by phreedom.
This commit is contained in:
parent
73a0cb57c5
commit
6327edd63f
|
@ -349,5 +349,18 @@ sub search :Local Args(0) {
|
|||
|
||||
}
|
||||
|
||||
sub log :Local :Args(1) {
|
||||
my ($self, $c, $path) = @_;
|
||||
|
||||
$path = ($ENV{NIX_STORE_DIR} || "/nix/store")."/$path";
|
||||
|
||||
my @outpaths = ($path);
|
||||
my $logPath = findLog($c, $path, @outpaths);
|
||||
notFound($c, "The build log of $path is not available.") unless defined $logPath;
|
||||
|
||||
$c->stash->{'plain'} = { data => (scalar logContents($logPath)) || " " };
|
||||
$c->forward('Hydra::View::Plain');
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in a new issue