Skip to content

Commit

Permalink
#202 Clean up OPOS closing logic in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
dostuffthatmatters committed Nov 8, 2023
1 parent 6141035 commit df2e42e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cli/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ def _stop_pyra_core() -> None:
exit(1)

try:
processes = [p.name() for p in psutil.process_iter()]
for executable in ["opus.exe", "OpusCore.exe"]:
if executable in processes:
exit_code = os.system(f"taskkill /f /im {executable}")
for p in psutil.process_iter():
process_name = p.name()
if process_name in ["opus.exe", "OpusCore.exe"]:
exit_code = os.system(f"taskkill /f /im {process_name}")
assert (
exit_code == 0
), f'taskkill of "{executable}" ended with an exit_code of {exit_code}'
), f'taskkill of "{process_name}" ended with an exit_code of {exit_code}'
_print_green("Successfully closed OPUS")
except Exception as e:
_print_red(f"Failed to close OPUS: {e}")
Expand Down

0 comments on commit df2e42e

Please sign in to comment.