Skip to content

Commit

Permalink
🩹 Fix bug of portageq on gentoo prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Nov 5, 2024
1 parent 91298e4 commit 657a661
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ repos:
exclude_types:
- zsh
- repo: https://github.com/rhysd/actionlint
rev: v1.7.3
rev: v1.7.4
hooks:
- id: actionlint
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.18
hooks:
- id: mdformat
additional_dependencies:
Expand All @@ -79,16 +79,16 @@ repos:
additional_dependencies:
- markdown-it-texmath
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.9.0-1
rev: v3.10.0-1
hooks:
- id: shfmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.2
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/kumaraditya303/mirrors-pyright
rev: v1.1.383
rev: v1.1.387
hooks:
- id: pyright

Expand Down
5 changes: 4 additions & 1 deletion src/termux_language_server/misc/ebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ def init_schema() -> dict[str, dict[str, Any]]:
schema["properties"][name]["type"] = "string"
else:
schema["properties"][name]["const"] = 0
eprefix = os.path.dirname(os.path.dirname(os.getenv("SHELL", "")))
path = (
check_output(split("portageq get_repo_path / gentoo")).decode().strip()
check_output(split(f"portageq get_repo_path {eprefix} gentoo"))
.decode()
.strip()
)
atom = f"({'|'.join(os.listdir(path))})"
schema["properties"]["LICENSE"]["pattern"] = rf"{atom}(( |\n){atom})*"
Expand Down

0 comments on commit 657a661

Please sign in to comment.