fix progress bar

This commit is contained in:
Celogeek 2023-01-03 19:58:31 +01:00
parent 3524ce6d04
commit 49e7f27a59
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A

View File

@ -169,14 +169,15 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) {
go func() {
wg.Wait()
bar.Close()
close(imageOutput)
}()
bar := NewBar(imageCount, "Processing", 1, 2)
for image := range imageOutput {
images = append(images, image)
bar.Add(1)
}
bar.Close()
if len(images) == 0 {
return nil, fmt.Errorf("image not found")