From 46e6439233aa21a77bef02a3eeb5e2175eb1e239 Mon Sep 17 00:00:00 2001 From: Mickael Date: Mon, 25 Feb 2019 23:53:46 +0100 Subject: [PATCH] add check ./common.sh cf kay0u ;-) --- package_linter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package_linter.py b/package_linter.py index 88ad7bc..cc57581 100755 --- a/package_linter.py +++ b/package_linter.py @@ -518,11 +518,10 @@ class Script(): "You can use 'ynh_print_info' or 'ynh_script_progression' for this." ) - def check_source_common(self): #test for standard execution if script["name"] in ["install","upgrade","remove"]: - count_common=len(re.findall("^source _common.sh",script["raw"],flags=re.MULTILINE)) + count_common=len(re.findall("^source _common.sh|^source ./_common.sh",script["raw"],flags=re.MULTILINE)) if count_common == 0: print_warning("Calling _common.sh seams not present in this script, please add \"source _common.sh\"") elif count_common > 1: @@ -530,7 +529,7 @@ class Script(): #test for "save" files else: - count_common=len(re.findall("^source _common.sh",script["raw"],flags=re.MULTILINE)) + count_common=len(re.findall("^source _common.sh|^source ./_common.sh",script["raw"],flags=re.MULTILINE)) count_common_save=len(re.findall("^source ../settings/scripts/_common.sh",script["raw"],flags=re.MULTILINE)) if count_common > 0 and count_common_save == 0: print_error("You must call _common.sh with \"source ../settings/scripts/_common.sh\" in this script to respect context execution") @@ -539,6 +538,7 @@ class Script(): elif count_common_save > 1: print_warning("Duplicates calls to _common.sh, please clean your code") + def main(): if len(sys.argv) != 2: print("Give one app package path.")