-
Notifications
You must be signed in to change notification settings - Fork 414
Feature/windows fixes #581
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
base: master
Are you sure you want to change the base?
Changes from all commits
5f57f6f
087a706
58aa6d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,9 +177,20 @@ def tell (self): | |
LCM_BIN_DIR = os.path.join(os.path.dirname(__file__), '..', 'bin') | ||
|
||
def run_script(name: str, args) -> int: | ||
file_extension = '.bat' if platform.system() == 'Windows' else '' | ||
try: | ||
return subprocess.call([os.path.join(LCM_BIN_DIR, name + file_extension), *args], close_fds=False) | ||
if platform.system() == 'Windows': | ||
candidates = [ | ||
os.path.join(LCM_BIN_DIR, f"{name}.bat"), | ||
os.path.join(LCM_BIN_DIR, f"{name}.exe") | ||
] | ||
else: | ||
candidates = [os.path.join(LCM_BIN_DIR, name)] | ||
|
||
for executable in candidates: | ||
if os.path.exists(executable): | ||
return subprocess.call([executable, *args], close_fds=False) | ||
|
||
raise FileNotFoundError(f"No executable found for {name} in {LCM_BIN_DIR}") | ||
Comment on lines
+181
to
+193
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can reproduce this issue. After running
These changes fix that issue for me. |
||
except KeyboardInterrupt: | ||
return 0 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving as these changes all look reasonable and don't appear to break anything for me, but they don't appear to fix this issue:
Both
lcm-logger
andlcm-logplayer
appear to be no-ops. No matter what commands I run, they immediately return with no output.