From 733838e5e369c273ed5481a935ea432ddda204d0 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 29 Nov 2021 17:19:07 -0300 Subject: [PATCH] [flatpak] improvement: exports share directory for root user is now '/usr/share/flatpak/exports/share' --- bauh/gems/flatpak/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bauh/gems/flatpak/__init__.py b/bauh/gems/flatpak/__init__.py index e6e18a35..ddc3335c 100644 --- a/bauh/gems/flatpak/__init__.py +++ b/bauh/gems/flatpak/__init__.py @@ -3,6 +3,7 @@ from pathlib import Path from packaging.version import parse as parse_version +from bauh.api import user from bauh.api.paths import CONFIG_DIR from bauh.commons import resource @@ -11,7 +12,7 @@ SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master CONFIG_FILE = f'{CONFIG_DIR}/flatpak.yml' FLATPAK_CONFIG_DIR = f'{CONFIG_DIR}/flatpak' UPDATES_IGNORED_FILE = f'{FLATPAK_CONFIG_DIR}/updates_ignored.txt' -EXPORTS_PATH = '{}/.local/share/flatpak/exports/share'.format(str(Path.home())) +EXPORTS_PATH = '/usr/share/flatpak/exports/share' if user.is_root() else f'{Path.home()}/.local/share/flatpak/exports/share' VERSION_1_2 = parse_version('1.2') VERSION_1_3 = parse_version('1.3') VERSION_1_4 = parse_version('1.4')