mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Also add app hooks after successful upgrade
This commit is contained in:
parent
ff93770529
commit
edf96bc778
1 changed files with 6 additions and 6 deletions
|
@ -386,12 +386,6 @@ def app_upgrade(auth, app=[], url=None, file=None):
|
||||||
status = _get_app_status(app_instance_name)
|
status = _get_app_status(app_instance_name)
|
||||||
status['remote'] = manifest.get('remote', None)
|
status['remote'] = manifest.get('remote', None)
|
||||||
|
|
||||||
# Clean hooks and add new ones
|
|
||||||
hook_remove(app_instance_name)
|
|
||||||
if 'hooks' in os.listdir(app_tmp_folder):
|
|
||||||
for hook in os.listdir(app_tmp_folder +'/hooks'):
|
|
||||||
hook_add(app_instance_name, app_tmp_folder +'/hooks/'+ hook)
|
|
||||||
|
|
||||||
# Retrieve arguments list for upgrade script
|
# Retrieve arguments list for upgrade script
|
||||||
# TODO: Allow to specify arguments
|
# TODO: Allow to specify arguments
|
||||||
args_odict = _parse_args_from_manifest(manifest, 'upgrade', auth=auth)
|
args_odict = _parse_args_from_manifest(manifest, 'upgrade', auth=auth)
|
||||||
|
@ -415,6 +409,12 @@ def app_upgrade(auth, app=[], url=None, file=None):
|
||||||
app_setting(app_instance_name, 'update_time', now)
|
app_setting(app_instance_name, 'update_time', now)
|
||||||
status['upgraded_at'] = now
|
status['upgraded_at'] = now
|
||||||
|
|
||||||
|
# Clean hooks and add new ones
|
||||||
|
hook_remove(app_instance_name)
|
||||||
|
if 'hooks' in os.listdir(app_tmp_folder):
|
||||||
|
for hook in os.listdir(app_tmp_folder +'/hooks'):
|
||||||
|
hook_add(app_instance_name, app_tmp_folder +'/hooks/'+ hook)
|
||||||
|
|
||||||
# Store app status
|
# Store app status
|
||||||
with open(app_setting_path + '/status.json', 'w+') as f:
|
with open(app_setting_path + '/status.json', 'w+') as f:
|
||||||
json.dump(status, f)
|
json.dump(status, f)
|
||||||
|
|
Loading…
Add table
Reference in a new issue