Skip to content

Commit 53eead0

Browse files
committed
[OMCProcessWSL] define work directory for WSL
1 parent ba49be8 commit 53eead0

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
@@ -1313,12 +1313,14 @@ def __init__(
13131313
# connect to the running omc instance using ZMQ
13141314
self._omc_port = self._omc_port_get()
13151315

1316-
def _wsl_cmd(self) -> list[str]: # get wsl base command
1316+
def _wsl_cmd(self, wsl_cwd: Optional[str] = None) -> list[str]: # get wsl base command
13171317
wsl_cmd = ['wsl']
13181318
if isinstance(self._wsl_distribution, str):
13191319
wsl_cmd += ['--distribution', self._wsl_distribution]
13201320
if isinstance(self._wsl_user, str):
13211321
wsl_cmd += ['--user', self._wsl_user]
1322+
if isinstance(wsl_cwd, str):
1323+
wsl_cmd += ['--cd', wsl_cwd]
13221324
wsl_cmd += ['--']
13231325

13241326
return wsl_cmd
@@ -1377,7 +1379,7 @@ def omc_run_data_update(self, omc_run_data: OMCSessionRunData, session: OMCSessi
13771379
"""
13781380
omc_run_data_copy = dataclasses.replace(omc_run_data)
13791381

1380-
omc_run_data_copy.cmd_prefix = self._wsl_cmd()
1382+
omc_run_data_copy.cmd_prefix = self._wsl_cmd(wsl_cwd=omc_run_data.cmd_path)
13811383

13821384
cmd_path = session.omcpath(omc_run_data_copy.cmd_path)
13831385
cmd_model_executable = cmd_path / omc_run_data_copy.cmd_model_name

0 commit comments

Comments
 (0)