Skip to content

Commit 74af832

Browse files
committed
[OMCProcessWSL] define work directory for WSL
1 parent af08ff4 commit 74af832

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

OMPython/OMCSession.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,12 +1364,14 @@ def __init__(
13641364
# connect to the running omc instance using ZMQ
13651365
self._omc_port = self._omc_port_get()
13661366

1367-
def _wsl_cmd(self) -> list[str]: # get wsl base command
1367+
def _wsl_cmd(self, wsl_cwd: Optional[str] = None) -> list[str]: # get wsl base command
13681368
wsl_cmd = ['wsl']
13691369
if isinstance(self._wsl_distribution, str):
13701370
wsl_cmd += ['--distribution', self._wsl_distribution]
13711371
if isinstance(self._wsl_user, str):
13721372
wsl_cmd += ['--user', self._wsl_user]
1373+
if isinstance(wsl_cwd, str):
1374+
wsl_cmd += ['--cd', wsl_cwd]
13731375
wsl_cmd += ['--']
13741376

13751377
return wsl_cmd
@@ -1428,7 +1430,7 @@ def omc_run_data_update(self, omc_run_data: OMCSessionRunData, session: OMCSessi
14281430
"""
14291431
omc_run_data_copy = dataclasses.replace(omc_run_data)
14301432

1431-
omc_run_data_copy.cmd_prefix = self._wsl_cmd()
1433+
omc_run_data_copy.cmd_prefix = self._wsl_cmd(wsl_cwd=omc_run_data.cmd_path)
14321434

14331435
cmd_path = session.omcpath(omc_run_data_copy.cmd_path)
14341436
cmd_model_executable = cmd_path / omc_run_data_copy.cmd_model_name

0 commit comments

Comments
 (0)