mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Merge pull request #25 from JocelynDelalande/jd-more-accurate-exit-match
[fix] search for "exit" more accurately
This commit is contained in:
commit
a525951161
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue