Skip to content

Commit 2c4a855

Browse files
committed
fix: don't use MW dir as workdir for non-MW containers
Closes #14.
1 parent f809b4a commit 2c4a855

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mwutil/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ def run_container_command(
129129
if workdir and not workdir.startswith("/"):
130130
# resolve relative paths against the MW installation directory
131131
workdir = config.mw_install_path + "/" + workdir
132-
# Use the MW installation directory provided in .env by default (#13)
133-
exec_options = ["-w", (workdir or config.mw_install_path)] + (exec_options or [])
132+
# For mediawiki containers, use the MW installation directory provided in .env by default (#13)
133+
workdir_option = ["-w", (workdir or config.mw_install_path)] if container_name.startswith("mediawiki") else []
134+
exec_options = workdir_option + (exec_options or [])
134135
return run_docker_command(
135136
config,
136137
["exec"] + exec_options + [container_name] + command,

0 commit comments

Comments
 (0)