Skip to content

Commit ec3c024

Browse files
committed
Collect logs
1 parent 3e6403b commit ec3c024

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

myst_libre/tools/myst_client.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def check_mystmd_installed(self):
8383
self.cprint(f"✗ Unexpected error occurred: {str(e)}", "red")
8484
raise
8585

86-
def run_command(self, *args, env_vars={},user=None,group=None):
86+
def run_command(self, *args, env_vars={}, user=None, group=None):
8787
"""
8888
Run a command using the MyST executable.
8989
@@ -136,15 +136,18 @@ def run_command(self, *args, env_vars={},user=None,group=None):
136136
if process.returncode != 0:
137137
raise subprocess.CalledProcessError(process.returncode, command, output='\n'.join(output), stderr='\n'.join(error_output))
138138

139-
return ''.join(output)
139+
# Capture the output in a variable for logging
140+
command_output = ''.join(output)
141+
142+
return command_output
140143
except subprocess.CalledProcessError as e:
141144
print(f"Error running command: {e}")
142145
print(f"Command output: {e.output}")
143146
print(f"Error output: {e.stderr}")
144-
return None
147+
return None, e.stderr
145148
except Exception as e:
146149
print(f"Unexpected error: {e}")
147-
return None
150+
return None, str(e)
148151

149152
def build(self, *args, user=None, group=None):
150153
"""

0 commit comments

Comments
 (0)