diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-02-27 15:43:07 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-02-27 15:43:07 +0100 |
| commit | 0cf5f137f886bd4e80868dcf2cf74b3f3b2c28d3 (patch) | |
| tree | 47116c98f2be78bf6b1f528e7af75ffc8289cd1f /minishell_test/hooks.py | |
| parent | c92f2be21c6be2d44cd836dd7f362e545b9a1a90 (diff) | |
| download | minishell_test-0cf5f137f886bd4e80868dcf2cf74b3f3b2c28d3.tar.gz minishell_test-0cf5f137f886bd4e80868dcf2cf74b3f3b2c28d3.tar.bz2 minishell_test-0cf5f137f886bd4e80868dcf2cf74b3f3b2c28d3.zip | |
Fixing #10 - bash error line with number 0 or 1
Diffstat (limited to 'minishell_test/hooks.py')
| -rw-r--r-- | minishell_test/hooks.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/minishell_test/hooks.py b/minishell_test/hooks.py index 531580a..6356080 100644 --- a/minishell_test/hooks.py +++ b/minishell_test/hooks.py @@ -6,12 +6,11 @@ # By: charles <me@cacharle.xyz> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/09/11 16:10:20 by charles #+# #+# # -# Updated: 2021/02/27 14:44:19 by cacharle ### ########.fr # +# Updated: 2021/02/27 15:40:25 by cacharle ### ########.fr # # # # ############################################################################ # import re -import os from minishell_test import config @@ -29,10 +28,10 @@ def error_line0(output): lines = output.split('\n') if len(lines) != 3: return output - prefix = "{}: -c: line 0: ".format(config.SHELL_REFERENCE_PATH) - if lines[0].find(prefix) != 0: + prefix = config.SHELL_REFERENCE_PREFIX + "-c: " + if not lines[0].startswith(prefix): return output - return lines[0].replace(prefix, "minishell: ") + "\n" + return lines[0].replace(prefix, config.MINISHELL_PREFIX, 1) + "\n" def discard(output): |
