Merge pull request #25 from JocelynDelalande/jd-more-accurate-exit-match

[fix] search for "exit" more accurately
This commit is contained in:
M5oul 2017-04-04 09:09:56 +02:00 committed by GitHub
commit a525951161

View file

@ -222,7 +222,7 @@ def check_verifications_done_before_modifying_system(script):
"""
ex = 0
for line_number, line in enumerate(script):
if "ynh_die" in line or "exit" in line:
if "ynh_die" in line or "exit " in line:
ex = line_number
cmds = ("cp", "mkdir", "rm", "chown", "chmod", "apt-get", "apt", "service",
@ -273,7 +273,7 @@ def check_non_helpers_usage(script):
ok = True
for line_nbr, line in enumerate(script):
if "exit" in line:
if "exit " in line:
print_wrong("Line {}: 'exit' command shouldn't be used. Use 'ynh_die' helper instead.".format(line_nbr + 1))
ok = False