Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Nov 25, 2024
1 parent 25ab2da commit c8aa357
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions myst_libre/tools/myst_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,20 @@ def run_command(self, *args, env_vars={},user=None,group=None):
env = os.environ.copy()
env.update(env_vars)

# Debug information
self.cprint(f"🐞 Running command from directory: {os.getcwd()}", "light_grey")
self.cprint(f"🐞 Set cwd to: {self.build_dir}", "light_grey")
self.cprint(f"🐞 Command: {' '.join(command)}", "light_grey")

if user and group:
uid = pwd.getpwnam(user).pw_uid
gid = grp.getgrnam(group).gr_gid
process = subprocess.Popen(command, env=env,
preexec_fn=lambda: os.setgid(gid) or os.setuid(uid),
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True,
cwd=self.build_dir)
else:
process = subprocess.Popen(command, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
process = subprocess.Popen(command, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd=self.build_dir)

output = []
error_output = []
Expand Down

0 comments on commit c8aa357

Please sign in to comment.