mirror of
https://github.com/ilyakooo0/odn.git
synced 2024-11-22 09:33:42 +03:00
Better way to check readiness
This commit is contained in:
parent
4ab5a926b1
commit
fd4f5a91bc
@ -52,13 +52,13 @@ colors = cycle [green, blue, magenta, cyan]
|
||||
|
||||
writeOutput :: [String] -> String -> Handle -> IO Bool
|
||||
writeOutput color prog h = do
|
||||
eof <- hIsEOF h
|
||||
if eof
|
||||
then return False
|
||||
else do
|
||||
inputAvailable <- hReady h
|
||||
if inputAvailable
|
||||
then do
|
||||
l <- hGetLine h
|
||||
putStrLn $ formatWith color (prog <> " | ") <> l
|
||||
return True
|
||||
else return False
|
||||
|
||||
prettifyProcesses :: [String] -> [String]
|
||||
prettifyProcesses ps' =
|
||||
|
Loading…
Reference in New Issue
Block a user