From f06e8de42359cff6cb93dad4a89c64078d864790 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 8 Oct 2020 12:03:46 +0200 Subject: Added syntax error discard --- src/hooks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/hooks.py') 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 -- cgit