Skip to content

Commit

Permalink
Adapt FlatManagerCheck to work in the sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
barthalion committed Nov 3, 2023
1 parent 5a9acd7 commit 87c440b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions flatpak_builder_lint/checks/flatmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 87c440b

Please sign in to comment.