Skip to content

Commit 1763b72

Browse files
committed
Include node on typedoc command
1 parent 1a4548a commit 1763b72

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

sphinx_js/analyzer_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
def program_name_on_this_platform(program: str) -> str:
1515
"""Return the name of the executable file on the current platform, given a
1616
command name with no extension."""
17+
18+
if os.access(program, os.X_OK):
19+
return program
20+
21+
path = shutil.which(program)
22+
if path and os.access(path, os.X_OK):
23+
return path
24+
1725
return program + ".cmd" if os.name == "nt" else program
1826

1927

sphinx_js/typedoc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@
2727

2828
@cache
2929
def typedoc_version_info(typedoc: str) -> tuple[tuple[int, ...], tuple[int, ...]]:
30+
command = Command("node")
31+
command.add(typedoc)
32+
command.add("--version")
3033
result = subprocess.run(
31-
[typedoc, "--version"],
34+
command.make(),
3235
capture_output=True,
3336
encoding="utf8",
3437
check=True,

0 commit comments

Comments
 (0)