mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Merge pull request #56 from Mickael-Martin/checksource
Add test of common file
This commit is contained in:
commit
febac1761c
1 changed files with 8 additions and 0 deletions
|
@ -405,6 +405,7 @@ class Script():
|
|||
self.check_set_usage()
|
||||
self.check_helper_usage_dependencies()
|
||||
self.check_deprecated_practices()
|
||||
self.check_source_common()
|
||||
|
||||
def check_verifications_done_before_modifying_system(self):
|
||||
"""
|
||||
|
@ -520,6 +521,12 @@ class Script():
|
|||
"You can use 'ynh_print_info' or 'ynh_script_progression' for this."
|
||||
)
|
||||
|
||||
def check_source_common(self):
|
||||
|
||||
if self.name in ["backup", "restore"]:
|
||||
if self.contains("source _common.sh") or self.contains("source ./_common.sh"):
|
||||
print_error("In the context of backup and restore script, you should load _common.sh with \"source ../settings/scripts/_common.sh\"")
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
|
@ -529,6 +536,7 @@ def main():
|
|||
app_path = sys.argv[1]
|
||||
header(app_path)
|
||||
App(app_path).analyze()
|
||||
|
||||
sys.exit(return_code)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue