浏览代码

ignore stdin when passed instead of throwing an error

Nick Sweeting 4 年之前
父节点
当前提交
06f6084e3b
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      archivebox/logging_util.py

+ 3 - 3
archivebox/logging_util.py

@@ -108,12 +108,12 @@ def reject_stdin(caller: str, stdin: Optional[IO]=sys.stdin) -> None:
     if not stdin.isatty():
     if not stdin.isatty():
         # stderr('READING STDIN TO REJECT...')
         # stderr('READING STDIN TO REJECT...')
         stdin_raw_text = stdin.read()
         stdin_raw_text = stdin.read()
-        if stdin_raw_text:
+        if stdin_raw_text.strip():
             # stderr('GOT STDIN!', len(stdin_str))
             # stderr('GOT STDIN!', len(stdin_str))
-            stderr(f'[X] The "{caller}" command does not accept stdin.', color='red')
+            stderr(f'[!] The "{caller}" command does not accept stdin (ignoring).', color='red')
             stderr(f'    Run archivebox "{caller} --help" to see usage and examples.')
             stderr(f'    Run archivebox "{caller} --help" to see usage and examples.')
             stderr()
             stderr()
-            raise SystemExit(1)
+            # raise SystemExit(1)
     return None
     return None