Starting on tool to check repository settings.
[rnaseq-cwl-training.git] / bin / util.py
index 2341bdb006b9bfae5d85243cc5d13dfe60e3b652..df350e7a7895bdfc656b1e64c3a66eead0a715d0 100644 (file)
@@ -151,3 +151,11 @@ def check_unwanted_files(dir_path, reporter):
         reporter.check(not os.path.exists(path),
                        path,
                        "Unwanted file found")
+
+
+def require(condition, message):
+    """Fail if condition not met."""
+
+    if not condition:
+        print(message, file=sys.stderr)
+        sys.exit(1)