mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
bugfix remove app
This commit is contained in:
parent
7d6722511f
commit
845c68a808
1 changed files with 10 additions and 4 deletions
|
@ -439,12 +439,18 @@ def app_remove(app):
|
||||||
raise YunoHostError(22, _("App is not installed"))
|
raise YunoHostError(22, _("App is not installed"))
|
||||||
|
|
||||||
app_setting_path = apps_setting_path + app
|
app_setting_path = apps_setting_path + app
|
||||||
os.system('chmod -R 777 '+ app_setting_path)
|
|
||||||
|
|
||||||
#TODO: display fail messages from script
|
#TODO: display fail messages from script
|
||||||
os.system('cp '+ app_setting_path + '/scripts/remove /tmp/yunohost_remove && chown admin: /tmp/yunohost_remove')
|
try:
|
||||||
if hook_exec('/tmp/yunohost_remove') != 0:
|
shutil.rmtree('/tmp/yunohost_remove')
|
||||||
os.system('chmod -hR 700 '+ app_setting_path)
|
except: pass
|
||||||
|
|
||||||
|
os.system('cp -a '+ app_setting_path + ' /tmp/yunohost_remove && chown -hR admin: /tmp/yunohost_remove')
|
||||||
|
os.system('chown -R admin: /tmp/yunohost_remove')
|
||||||
|
os.system('chmod -R u+rX /tmp/yunohost_remove')
|
||||||
|
|
||||||
|
if hook_exec('/tmp/yunohost_remove/scripts/remove') != 0:
|
||||||
|
pass
|
||||||
|
|
||||||
if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path)
|
if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path)
|
||||||
os.remove('/tmp/yunohost_remove')
|
os.remove('/tmp/yunohost_remove')
|
||||||
|
|
Loading…
Add table
Reference in a new issue