diff --git a/beangulp/__init__.py b/beangulp/__init__.py index eef15a7..b073b68 100644 --- a/beangulp/__init__.py +++ b/beangulp/__init__.py @@ -254,6 +254,8 @@ def _identify(ctx: "Ingest", src: str, failfast: bool, verbose: bool): log = utils.logger(verbose) errors = exceptions.ExceptionsTrap(log) + any_importer_found = False + for filename in _walk(src, log): with errors: importer = identify.identify(ctx.importers, filename) @@ -261,6 +263,8 @@ def _identify(ctx: "Ingest", src: str, failfast: bool, verbose: bool): log("") # Newline. continue + any_importer_found = True + # Signal processing of this document. log(" ...", nl=False) @@ -277,6 +281,9 @@ def _identify(ctx: "Ingest", src: str, failfast: bool, verbose: bool): if errors: sys.exit(1) + if not any_importer_found: + sys.exit(100) + def _importer(importer): """Check that the passed instance implements the Importer interface. diff --git a/beangulp/tests/identify.rst b/beangulp/tests/identify.rst index 7b8f31b..e649cb5 100644 --- a/beangulp/tests/identify.rst +++ b/beangulp/tests/identify.rst @@ -55,7 +55,7 @@ Test with an empty downloads directory: >>> r = run('identify', downloads) >>> r.exit_code - 0 + 100 >>> print(r.output) Add some documents: