Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: detect .bat and .cmd executables on Windows #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions aw_qt/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ def is_executable(path: str, filename: str) -> bool:
return False
# On windows all files ending with .exe are executables
if platform.system() == "Windows":
return filename.endswith(".exe")
return (
filename.endswith(".exe")
or filename.endswith(".bat")
or filename.endswith(".cmd")
)
# On Unix platforms all files having executable permissions are executables
# We do not however want to include .desktop files
else: # Assumes Unix
Expand Down Expand Up @@ -63,10 +67,10 @@ def _filename_to_name(filename: str) -> str:


def _discover_modules_bundled() -> List["Module"]:
"""Use ``_discover_modules_in_directory`` to find all bundled modules """
"""Use ``_discover_modules_in_directory`` to find all bundled modules"""
search_paths = [_module_dir, _parent_dir]
if platform.system() == "Darwin":
macos_dir = os.path.abspath(os.path.join(_parent_dir, os.pardir, 'MacOS'))
macos_dir = os.path.abspath(os.path.join(_parent_dir, os.pardir, "MacOS"))
search_paths.append(macos_dir)
logger.info("Searching for bundled modules in: {}".format(search_paths))

Expand Down