diff options
author | Nick White <git@njw.name> | 2022-01-31 17:09:16 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2022-01-31 17:09:16 +0000 |
commit | 4fae7d93e0c07d5f6fc4c33db389c60d95276d01 (patch) | |
tree | 2bd9092764324b7f3927b57338ee9192fe5ec27b | |
parent | 7fe36a34e661e0ffc4d8cb98733e2f586cac9e8d (diff) |
pipeline: Fail if no images are present
-rw-r--r-- | internal/pipeline/put.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/pipeline/put.go b/internal/pipeline/put.go index 68ad70e..aba9e0e 100644 --- a/internal/pipeline/put.go +++ b/internal/pipeline/put.go @@ -51,6 +51,7 @@ func CheckImages(ctx context.Context, dir string) error { close(checker) }() + n := 0 for path := range checker { select { case <-ctx.Done(): @@ -70,6 +71,11 @@ func CheckImages(ctx context.Context, dir string) error { if err != nil { return fmt.Errorf("Decoding image %s failed: %v", path, err) } + n++ + } + + if n == 0 { + return fmt.Errorf("No images found") } return nil |