avoid displaying meter before data is received

The caller may be like glacier, and be running an action that may print
a message and fail. So don't start displaying the meter until data is
flowing, to avoid getting in the way of such messages being displayed.
This commit is contained in:
Joey Hess 2012-11-25 16:11:38 -04:00
parent 9792c5dd78
commit 59da54f763

View file

@ -78,7 +78,6 @@ meteredBytes combinemeterupdate size a = withOutputType go
progress <- liftIO $ newProgress "" size
meter <- liftIO $ newMeter progress "B" 25 (renderNums binaryOpts 1)
showOutput
liftIO $ displayMeter stdout meter
r <- a $ \n -> liftIO $ do
incrP progress n
displayMeter stdout meter