diff --git a/flatpak_builder_lint/checks/flatmanager.py b/flatpak_builder_lint/checks/flatmanager.py index 8860e7d5..5d7edfae 100644 --- a/flatpak_builder_lint/checks/flatmanager.py +++ b/flatpak_builder_lint/checks/flatmanager.py @@ -8,9 +8,18 @@ class FlatManagerCheck(Check): def check_repo(self, path: str) -> None: + flathub_hooks_cfg_paths = [ + "/run/host/etc/flathub-hooks.json", + "/etc/flathub-hooks.json", + ] + if build_id := os.getenv("FLAT_MANAGER_BUILD_ID"): - with open("/etc/flathub-hooks.json") as f: - flathub_hooks_cfg = json.load(f) + flathub_hooks_cfg = {} + for flathub_hooks_cfg_path in flathub_hooks_cfg_paths: + if os.path.exists(flathub_hooks_cfg_path): + with open(flathub_hooks_cfg_path) as f: + flathub_hooks_cfg = json.load(f) + break flatmgr_url = os.getenv("FLAT_MANAGER_URL") if not flatmgr_url: diff --git a/pyproject.toml b/pyproject.toml index 9232a559..1820474b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "flatpak_builder_lint" -version = "2.0.9" +version = "2.0.10" description = "A linter for flatpak-builder manifests" authors = ["Bartłomiej Piotrowski "] license = "MIT"