nbenedek 6ab0be6f9a
shaarli: Completely uninstall app
* remove data directory when app is uninstalled

Tests:
1. Install and configure the app
2. Reinstall app and confirm the initial setup page is shown

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Fix uninstall test by setting up after reinstall]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-04-13 07:27:28 +05:30

13 lines
261 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""Configure Shaarli."""
import shutil
from plinth.actions import privileged
@privileged
def uninstall():
"""Remove Shaarli's data directory."""
shutil.rmtree('/var/lib/shaarli/data', ignore_errors=True)