Fix "Use of uninitialized value $mode"

This commit is contained in:
Eelco Dolstra 2015-10-09 15:06:57 +02:00
parent ca58e97691
commit 3fa3e6414c

View file

@ -134,6 +134,7 @@ sub view_log : Chained('buildChain') PathPart('log') {
sub showLog {
my ($c, $mode, $finished, $drvPath, @outPaths) = @_;
$mode //= "pretty";
my $logPath = findLog($c, $drvPath, @outPaths);
@ -146,7 +147,7 @@ sub showLog {
|| (($mode eq "tail" || $mode eq "tail-reload") && $logPath !~ /\.bz2$/)
|| $size < 64 * 1024 * 1024;
if (!$mode) {
if ($mode eq "pretty") {
# !!! quick hack
my $pipeline = ($logPath =~ /.bz2$/ ? "bzip2 -d < $logPath" : "cat $logPath")
. " | nix-log2xml | xsltproc " . $c->path_to("xsl/mark-errors.xsl") . " -"