Skip to content

Commit 359cafc

Browse files
committed
🚸 Don't recognize scripts/build.sh as termux build script
1 parent 42817d9 commit 359cafc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ repos:
8383
hooks:
8484
- id: shfmt
8585
- repo: https://github.com/astral-sh/ruff-pre-commit
86-
rev: v0.4.10
86+
rev: v0.5.4
8787
hooks:
8888
- id: ruff
8989
- id: ruff-format
9090
- repo: https://github.com/kumaraditya303/mirrors-pyright
91-
rev: v1.1.368
91+
rev: v1.1.372
9292
hooks:
9393
- id: pyright
9494

src/termux_language_server/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ def get_filetype(uri: str) -> FILETYPE | Literal[""]:
6767
:type uri: str
6868
:rtype: FILETYPE | Literal[""]
6969
"""
70+
dirname = os.path.basename(os.path.dirname(uri))
7071
basename = os.path.basename(uri)
7172
ext = uri.split(os.path.extsep)[-1]
72-
if basename == "build.sh":
73+
if basename == "build.sh" and dirname != "scripts":
7374
return "build.sh"
7475
if basename.endswith(".subpackage.sh"):
7576
return "subpackage.sh"

0 commit comments

Comments
 (0)