From b89eb4c3e83b5a5baf37a0a490669ba1031b0d31 Mon Sep 17 00:00:00 2001 From: Moul Date: Tue, 15 Nov 2016 13:46:07 +0100 Subject: [PATCH] =?UTF-8?q?[enh]=20also=20check=20'ynh=5Fdie'=20helper,=20?= =?UTF-8?q?as=20'exit'=20command,=E2=80=A6=20=E2=80=A6is=20used=20before?= =?UTF-8?q?=20system=20modifications.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package_linter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package_linter.py b/package_linter.py index 95267c7..a70011c 100755 --- a/package_linter.py +++ b/package_linter.py @@ -181,7 +181,7 @@ def check_verifications_done_before_modifying_system(script): """ ex, i = 0, 0 while i < len(script): - if "exit" in script[i]: + if "ynh_die" in script[i] or "exit" in script[i]: ex = i i += 1 cmd = ("cp", "mkdir", "rm", "chown", "chmod", "apt-get", "apt", "service", @@ -198,12 +198,12 @@ def check_verifications_done_before_modifying_system(script): i += 1 if ok == 0: print(c.FAIL + "✘ At line", ex + 1, - "'exit' command is executed with system modification before.") + "'ynh_die' or 'exit' command is executed with system modification before.") print("This system modification is an issue if a verification exit the script.") print("You should move this verification before any system modification." + c.END) else: print_right( - "Verifications (with exit commands) are done before any system modification.") + "Verifications (with 'ynh_die' or 'exit' commands) are done before any system modification.") if __name__ == '__main__': os.system("clear")