Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure esbuild can be detected on windows #7625

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Changes from 2 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
15 changes: 9 additions & 6 deletions panel/io/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,18 @@ def setup_build_dir(build_dir: str | os.PathLike | None = None):
shutil.rmtree(temp_dir)


def check_cli_tool(tool_name):
def check_cli_tool(tool_name: str) -> bool:
philippjfr marked this conversation as resolved.
Show resolved Hide resolved
try:
result = subprocess.run([tool_name, '--version'], capture_output=True)
if result.returncode == 0:
return True
else:
return False
code = result.returncode == 0
except Exception:
return False
code = 1
if not code:
return True
if sys.platform == 'win32':
tool_name = f'{tool_name}.cmd'
return check_cli_tool(tool_name)
return False


def find_module_bundles(module_spec: str) -> dict[pathlib.Path, list[ReactiveESM]]:
Expand Down
Loading