mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] DRY, easier to maintain here
This commit is contained in:
parent
9cefc60161
commit
2d0b5edd23
1 changed files with 6 additions and 16 deletions
|
@ -641,14 +641,9 @@ def app_upgrade(auth, app=[], url=None, file=None):
|
||||||
os.system('rm -rf "%s/scripts" "%s/manifest.json %s/conf"' % (app_setting_path, app_setting_path, app_setting_path))
|
os.system('rm -rf "%s/scripts" "%s/manifest.json %s/conf"' % (app_setting_path, app_setting_path, app_setting_path))
|
||||||
os.system('mv "%s/manifest.json" "%s/scripts" %s' % (extracted_app_folder, extracted_app_folder, app_setting_path))
|
os.system('mv "%s/manifest.json" "%s/scripts" %s' % (extracted_app_folder, extracted_app_folder, app_setting_path))
|
||||||
|
|
||||||
if os.path.exists(os.path.join(extracted_app_folder, "actions.json")):
|
for file_to_copy in ["actions.json", "config_panel.json", "conf"]:
|
||||||
os.system('cp -R %s/actions.json %s' % (extracted_app_folder, app_setting_path))
|
if os.path.exists(os.path.join(extracted_app_folder, file_to_copy)):
|
||||||
|
os.system('cp -R %s/%s %s' % (extracted_app_folder, file_to_copy, app_setting_path))
|
||||||
if os.path.exists(os.path.join(extracted_app_folder, "config_panel.json")):
|
|
||||||
os.system('cp -R %s/config_panel.json %s' % (extracted_app_folder, app_setting_path))
|
|
||||||
|
|
||||||
if os.path.exists(os.path.join(extracted_app_folder, "conf")):
|
|
||||||
os.system('cp -R %s/conf %s' % (extracted_app_folder, app_setting_path))
|
|
||||||
|
|
||||||
# So much win
|
# So much win
|
||||||
upgraded_apps.append(app_instance_name)
|
upgraded_apps.append(app_instance_name)
|
||||||
|
@ -764,14 +759,9 @@ def app_install(auth, app, label=None, args=None, no_remove_on_failure=False):
|
||||||
os.system('cp %s/manifest.json %s' % (extracted_app_folder, app_setting_path))
|
os.system('cp %s/manifest.json %s' % (extracted_app_folder, app_setting_path))
|
||||||
os.system('cp -R %s/scripts %s' % (extracted_app_folder, app_setting_path))
|
os.system('cp -R %s/scripts %s' % (extracted_app_folder, app_setting_path))
|
||||||
|
|
||||||
if os.path.exists(os.path.join(extracted_app_folder, "actions.json")):
|
for file_to_copy in ["actions.json", "config_panel.json", "conf"]:
|
||||||
os.system('cp -R %s/actions.json %s' % (extracted_app_folder, app_setting_path))
|
if os.path.exists(os.path.join(extracted_app_folder, file_to_copy)):
|
||||||
|
os.system('cp -R %s/%s %s' % (extracted_app_folder, file_to_copy, app_setting_path))
|
||||||
if os.path.exists(os.path.join(extracted_app_folder, "config_panel.json")):
|
|
||||||
os.system('cp -R %s/config_panel.json %s' % (extracted_app_folder, app_setting_path))
|
|
||||||
|
|
||||||
if os.path.exists(os.path.join(extracted_app_folder, "conf")):
|
|
||||||
os.system('cp -R %s/conf %s' % (extracted_app_folder, app_setting_path))
|
|
||||||
|
|
||||||
# Execute the app install script
|
# Execute the app install script
|
||||||
install_retcode = 1
|
install_retcode = 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue