Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sphinx_js/analyzer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
def program_name_on_this_platform(program: str) -> str:
"""Return the name of the executable file on the current platform, given a
command name with no extension."""

if os.access(program, os.X_OK):
return program

path = shutil.which(program)
if path and os.access(path, os.X_OK):
return path

return program + ".cmd" if os.name == "nt" else program


Expand Down
5 changes: 4 additions & 1 deletion sphinx_js/typedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@

@cache
def typedoc_version_info(typedoc: str) -> tuple[tuple[int, ...], tuple[int, ...]]:
command = Command("node")
command.add(typedoc)
command.add("--version")
result = subprocess.run(
[typedoc, "--version"],
command.make(),
capture_output=True,
encoding="utf8",
check=True,
Expand Down