mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Don't miserably crash if there's nothing to grep
This commit is contained in:
parent
769aa810fc
commit
609580adb3
1 changed files with 2 additions and 2 deletions
|
@ -1448,8 +1448,8 @@ class Script(TestSuite):
|
||||||
|
|
||||||
@test(only=["install", "upgrade"])
|
@test(only=["install", "upgrade"])
|
||||||
def deprecated_replace_string(self):
|
def deprecated_replace_string(self):
|
||||||
cmd1 = "grep -Ec 'ynh_replace_string' '%s'" % self.path
|
cmd1 = "grep -Ec 'ynh_replace_string' '%s' || true" % self.path
|
||||||
cmd2 = "grep -Ec 'ynh_replace_string.*__\w+__' '%s'" % 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())
|
count1 = int(subprocess.check_output(cmd1, shell=True).decode('utf-8').strip())
|
||||||
count2 = int(subprocess.check_output(cmd2, shell=True).decode('utf-8').strip())
|
count2 = int(subprocess.check_output(cmd2, shell=True).decode('utf-8').strip())
|
||||||
|
|
Loading…
Reference in a new issue