diff options
author | Nick White <git@njw.name> | 2021-07-08 15:36:45 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2021-07-08 15:36:45 +0100 |
commit | 72e7949b8ce84bb0742b977c3827fda6ca0a752e (patch) | |
tree | b41f7975e3b48054d4e7ee7f3351553dc44e7fdf /cmd/rescribe | |
parent | 690181056991c0c5ecea3de019581da0243d7635 (diff) |
rescribe: Exit with an error if directory doesn't exist
Diffstat (limited to 'cmd/rescribe')
-rw-r--r-- | cmd/rescribe/main.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/rescribe/main.go b/cmd/rescribe/main.go index 814504b..4404789 100644 --- a/cmd/rescribe/main.go +++ b/cmd/rescribe/main.go @@ -353,7 +353,11 @@ func addTxtVersion(hocrfn string) error { } func uploadbook(dir string, name string, conn Pipeliner) error { - err := pipeline.CheckImages(dir) + _, err := os.Stat(dir) + if err != nil && !os.IsExist(err) { + return fmt.Errorf("Error: directory %s not found", dir) + } + err = pipeline.CheckImages(dir) if err != nil { return fmt.Errorf("Error with images in %s: %v", dir, err) } |