mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
[enh] do not throw an error if 'backup' or 'restore script is missing.
This commit is contained in:
parent
fdda64aaf7
commit
64f9360d80
1 changed files with 4 additions and 2 deletions
|
@ -37,6 +37,7 @@ def print_wrong(str):
|
||||||
def check_files_exist(app_path):
|
def check_files_exist(app_path):
|
||||||
"""
|
"""
|
||||||
Check files exist
|
Check files exist
|
||||||
|
'backup' and 'restore' scripts are mandatory
|
||||||
"""
|
"""
|
||||||
return_code = 0
|
return_code = 0
|
||||||
|
|
||||||
|
@ -44,12 +45,13 @@ def check_files_exist(app_path):
|
||||||
fnames = ("manifest.json", "scripts/install", "scripts/remove",
|
fnames = ("manifest.json", "scripts/install", "scripts/remove",
|
||||||
"scripts/upgrade", "scripts/backup", "scripts/restore", "LICENSE", "README.md")
|
"scripts/upgrade", "scripts/backup", "scripts/restore", "LICENSE", "README.md")
|
||||||
|
|
||||||
for fname in fnames:
|
for nbr, fname in enumerate(fnames):
|
||||||
if check_file_exist(app_path + "/" + fname):
|
if check_file_exist(app_path + "/" + fname):
|
||||||
print_right(fname)
|
print_right(fname)
|
||||||
else:
|
else:
|
||||||
print_wrong(fname)
|
print_wrong(fname)
|
||||||
return_code = 1
|
if nbr != 4 and nbr != 5:
|
||||||
|
return_code = 1
|
||||||
|
|
||||||
return return_code
|
return return_code
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue