chore: Refactor run_command function in build.py to handle exceptions

This commit is contained in:
Théophile Diot 2024-07-31 10:48:49 +01:00
parent 43142134e8
commit 6674c7ca38
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -41,7 +41,7 @@ def run_command(command: List[str]) -> int:
"""Utils to run a subprocess command. This is usefull to run npm commands to build vite project"""
print(f"Running command: {command}", flush=True)
try:
process = Popen(command, stdout=PIPE, stderr=PIPE, cwd=current_directory, text=True)
process = Popen(command, stdout=PIPE, stderr=PIPE, cwd=current_directory.as_posix(), text=True)
while process.poll() is None:
if process.stdout is not None:
for line in process.stdout: