Skip to content

Commit c8aa357

Browse files
committed
try this
1 parent 25ab2da commit c8aa357

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

myst_libre/tools/myst_client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,20 @@ def run_command(self, *args, env_vars={},user=None,group=None):
100100
env = os.environ.copy()
101101
env.update(env_vars)
102102

103+
# Debug information
104+
self.cprint(f"🐞 Running command from directory: {os.getcwd()}", "light_grey")
105+
self.cprint(f"🐞 Set cwd to: {self.build_dir}", "light_grey")
106+
self.cprint(f"🐞 Command: {' '.join(command)}", "light_grey")
107+
103108
if user and group:
104109
uid = pwd.getpwnam(user).pw_uid
105110
gid = grp.getgrnam(group).gr_gid
106111
process = subprocess.Popen(command, env=env,
107112
preexec_fn=lambda: os.setgid(gid) or os.setuid(uid),
108-
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
113+
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True,
114+
cwd=self.build_dir)
109115
else:
110-
process = subprocess.Popen(command, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
116+
process = subprocess.Popen(command, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd=self.build_dir)
111117

112118
output = []
113119
error_output = []

0 commit comments

Comments
 (0)