1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #11961 from dmcgowan/fix-build-progress-output-11849

Fix progress reader output on close
This commit is contained in:
Michael Crosby 2015-03-31 14:04:33 -07:00
commit da6248751b

View file

@ -1,9 +1,10 @@
package progressreader
import (
"io"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/streamformatter"
"io"
)
// Reader with progress bar
@ -43,6 +44,7 @@ func (config *Config) Read(p []byte) (n int, err error) {
return read, err
}
func (config *Config) Close() error {
config.Current = config.Size
config.Out.Write(config.Formatter.FormatProgress(config.ID, config.Action, &jsonmessage.JSONProgress{Current: config.Current, Total: config.Size}))
return config.In.Close()
}