mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Add app hooks after the install to allow modifications
This commit is contained in:
parent
865e3ec8cb
commit
ff93770529
1 changed files with 6 additions and 7 deletions
|
@ -507,12 +507,6 @@ def app_install(auth, app, label=None, args=None):
|
|||
shutil.rmtree(app_setting_path)
|
||||
os.makedirs(app_setting_path)
|
||||
|
||||
# Clean hooks and add new ones
|
||||
hook_remove(app_instance_name)
|
||||
if 'hooks' in os.listdir(app_tmp_folder):
|
||||
for file in os.listdir(app_tmp_folder +'/hooks'):
|
||||
hook_add(app_instance_name, app_tmp_folder +'/hooks/'+ file)
|
||||
|
||||
# Set initial app settings
|
||||
app_settings = {
|
||||
'id': app_instance_name,
|
||||
|
@ -557,7 +551,6 @@ def app_install(auth, app, label=None, args=None):
|
|||
app=app_instance_name))
|
||||
|
||||
# Clean tmp folders
|
||||
hook_remove(app_instance_name)
|
||||
shutil.rmtree(app_setting_path)
|
||||
shutil.rmtree(app_tmp_folder)
|
||||
|
||||
|
@ -566,6 +559,12 @@ def app_install(auth, app, label=None, args=None):
|
|||
m18n.g('operation_interrupted'))
|
||||
raise MoulinetteError(errno.EIO, m18n.n('installation_failed'))
|
||||
|
||||
# Clean hooks and add new ones
|
||||
hook_remove(app_instance_name)
|
||||
if 'hooks' in os.listdir(app_tmp_folder):
|
||||
for file in os.listdir(app_tmp_folder +'/hooks'):
|
||||
hook_add(app_instance_name, app_tmp_folder +'/hooks/'+ file)
|
||||
|
||||
# Store app status
|
||||
with open(app_setting_path + '/status.json', 'w+') as f:
|
||||
json.dump(status, f)
|
||||
|
|
Loading…
Add table
Reference in a new issue