mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] save the conf/ directory of app during installation and upgrade
This commit is contained in:
parent
542528ab05
commit
aea13bc3e8
1 changed files with 8 additions and 2 deletions
|
@ -621,10 +621,13 @@ def app_upgrade(auth, app=[], url=None, file=None):
|
|||
with open(app_setting_path + '/status.json', 'w+') as f:
|
||||
json.dump(status, f)
|
||||
|
||||
# Replace scripts and manifest
|
||||
os.system('rm -rf "%s/scripts" "%s/manifest.json"' % (app_setting_path, app_setting_path))
|
||||
# Replace scripts and manifest and conf (if exists)
|
||||
os.system('rm -rf "%s/scripts" "%s/manifest.json %/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))
|
||||
|
||||
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
|
||||
upgraded_apps.append(app_instance_name)
|
||||
logger.success(m18n.n('app_upgraded', app=app_instance_name))
|
||||
|
@ -733,6 +736,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 -R %s/scripts %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
|
||||
install_retcode = 1
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue