Skip to content

Commit 998eab0

Browse files
committed
[OMCProcessWSL] define work directory for WSL
1 parent deca0b1 commit 998eab0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

OMPython/OMCSession.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,12 +1398,15 @@ def __init__(
13981398
# connect to the running omc instance using ZMQ
13991399
self._omc_port = self._omc_port_get()
14001400

1401-
def _wsl_cmd(self) -> list[str]: # get wsl base command
1401+
def _wsl_cmd(self, wsl_cwd: Optional[str] = None) -> list[str]:
1402+
# get wsl base command
14021403
wsl_cmd = ['wsl']
14031404
if isinstance(self._wsl_distribution, str):
14041405
wsl_cmd += ['--distribution', self._wsl_distribution]
14051406
if isinstance(self._wsl_user, str):
14061407
wsl_cmd += ['--user', self._wsl_user]
1408+
if isinstance(wsl_cwd, str):
1409+
wsl_cmd += ['--cd', wsl_cwd]
14071410
wsl_cmd += ['--']
14081411

14091412
return wsl_cmd
@@ -1462,7 +1465,7 @@ def omc_run_data_update(self, omc_run_data: OMCSessionRunData, session: OMCSessi
14621465
"""
14631466
omc_run_data_copy = dataclasses.replace(omc_run_data)
14641467

1465-
omc_run_data_copy.cmd_prefix = self._wsl_cmd()
1468+
omc_run_data_copy.cmd_prefix = self._wsl_cmd(wsl_cwd=omc_run_data.cmd_path)
14661469

14671470
cmd_path = session.omcpath(omc_run_data_copy.cmd_path)
14681471
cmd_model_executable = cmd_path / omc_run_data_copy.cmd_model_name

0 commit comments

Comments
 (0)