From 609580adb3284f8e76b15f3deae9b7847f574f6b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 10 May 2021 21:15:55 +0200 Subject: [PATCH] Don't miserably crash if there's nothing to grep --- package_linter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package_linter.py b/package_linter.py index 923d888..83dec9e 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1448,8 +1448,8 @@ class Script(TestSuite): @test(only=["install", "upgrade"]) def deprecated_replace_string(self): - cmd1 = "grep -Ec 'ynh_replace_string' '%s'" % self.path - cmd2 = "grep -Ec 'ynh_replace_string.*__\w+__' '%s'" % self.path + cmd1 = "grep -Ec 'ynh_replace_string' '%s' || true" % self.path + cmd2 = "grep -Ec 'ynh_replace_string.*__\w+__' '%s' || true" % self.path count1 = int(subprocess.check_output(cmd1, shell=True).decode('utf-8').strip()) count2 = int(subprocess.check_output(cmd2, shell=True).decode('utf-8').strip())