fix: detect .bat and .cmd executables on Windows#81
Conversation
|
This PR didn't seem to work for the person who reported the issue. Needs manual testing. |
|
Re-checked this against the later issue history around #110 and the current My read now is that this PR is still relevant:
So unless there was negative manual testing specifically against If helpful, I think the smallest next step would be to manually test exactly this matrix on Windows:
If that passes, this PR (or a refreshed equivalent) still seems mergeable to me. |
|
@greptileai review |
Greptile SummaryThis PR fixes Windows module detection by adding
Confidence Score: 2/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[File discovered: aw-server.bat] --> B{is_executable?}
B -->|".bat" on Windows ✅| C[_filename_to_name]
C --> D["Only strips .exe → name = 'aw-server.bat' ❌"]
D --> E{autostart check: name in autostart_modules?}
E -->|"'aw-server.bat' != 'aw-server' ❌"| F[Module not started]
D --> G{exclusion check: name in exclude list?}
G -->|"'aw-qt.bat' != 'aw-qt' ❌"| H[aw-qt not excluded from modules]
|
|
@TimeToBuildBob Address review |
|
I dug into the remaining Greptile comment and it looks correct: this branch adds I fixed that locally by updating def _filename_to_name(filename: str) -> str:
if platform.system() == "Windows":
for ext in (".exe", ".bat", ".cmd"):
if filename.endswith(ext):
return filename[: -len(ext)]
return filenameLocal validation:
I also created the fix commit locally as So my updated read: the PR is conceptually right but still not merge-ready until this |
|
@TimeToBuildBob You fix it |
|
Fixed in #126. Since I don't have push access to the ActivityWatch org branch, I pushed the fix to my fork and opened a new PR. The new PR includes both the original |
|
Merged #126, closing. |
Without this fix, aw-qt wouldn't detect modules as they end in
.cmdor.bat(not sure which).Reported here: https://discord.com/channels/755040852727955476/755334568977891348/956531050627104832
The user got the following output:
Not sure why aw-client becomes an .exe but aw-server etc becomes a .bat or .cmd