Fix input redirection for hyperfine
For some reason, Console.IsInputRedirected is true when run under hyperfine even if we're not redirecting anything. I wonder if hyperfine is opening an input channel in case it's needed? Either way, the fix is pretty simply to try reading from stdin and then falling back to the file on disk if our input set is still empty afterward.
This commit is contained in:
11
src/Util.cs
11
src/Util.cs
@ -22,11 +22,12 @@ internal static class Util
|
|||||||
lines.Add(line);
|
lines.Add(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
return lines;
|
if (lines.Any())
|
||||||
}
|
{
|
||||||
else
|
return lines;
|
||||||
{
|
}
|
||||||
return File.ReadAllLines(filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return File.ReadAllLines(filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user