aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-08 12:03:46 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-08 12:03:46 +0200
commitf06e8de42359cff6cb93dad4a89c64078d864790 (patch)
tree7194a39240ca7afb00d29889ce6fda0992a04174 /src/hooks.py
parentc48f9194ac7cd2a15d0f86d8d03b0a8d6001d387 (diff)
downloadminishell_test-f06e8de42359cff6cb93dad4a89c64078d864790.tar.gz
minishell_test-f06e8de42359cff6cb93dad4a89c64078d864790.tar.bz2
minishell_test-f06e8de42359cff6cb93dad4a89c64078d864790.zip
Added syntax error discard
Diffstat (limited to 'src/hooks.py')
-rw-r--r--src/hooks.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hooks.py b/src/hooks.py
index 2d55bbb..5ec2dde 100644
--- a/src/hooks.py
+++ b/src/hooks.py
@@ -6,12 +6,13 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 16:10:20 by charles #+# #+# #
-# Updated: 2020/10/07 15:18:13 by cacharle ### ########.fr #
+# Updated: 2020/10/08 11:43:54 by cacharle ### ########.fr #
# #
# ############################################################################ #
import re
import sys
+import os
import config
@@ -23,6 +24,10 @@ def sort_lines(output):
def error_line0(output):
"""Replace "/bin/bash: -c: line 0:" by "minishell:" and delete the second line"""
+ error_message = os.environ.get("MINISHELL_TEST_DONT_CHECK_ERROR_MESSAGE")
+ if error_message is not None and error_message == "yes":
+ return "DISCARDED BY TEST"
+
lines = output.split('\n')
if len(lines) != 3:
return output