Skip to content

Commit a4a4a4f

Browse files
committed
[OMCProcessWSL] define work directory for WSL
1 parent 77b0fc4 commit a4a4a4f

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
@@ -1364,12 +1364,15 @@ 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]:
1368+
# get wsl base command
13681369
wsl_cmd = ['wsl']
13691370
if isinstance(self._wsl_distribution, str):
13701371
wsl_cmd += ['--distribution', self._wsl_distribution]
13711372
if isinstance(self._wsl_user, str):
13721373
wsl_cmd += ['--user', self._wsl_user]
1374+
if isinstance(wsl_cwd, str):
1375+
wsl_cmd += ['--cd', wsl_cwd]
13731376
wsl_cmd += ['--']
13741377

13751378
return wsl_cmd
@@ -1428,7 +1431,7 @@ def omc_run_data_update(self, omc_run_data: OMCSessionRunData, session: OMCSessi
14281431
"""
14291432
omc_run_data_copy = dataclasses.replace(omc_run_data)
14301433

1431-
omc_run_data_copy.cmd_prefix = self._wsl_cmd()
1434+
omc_run_data_copy.cmd_prefix = self._wsl_cmd(wsl_cwd=omc_run_data.cmd_path)
14321435

14331436
cmd_path = session.omcpath(omc_run_data_copy.cmd_path)
14341437
cmd_model_executable = cmd_path / omc_run_data_copy.cmd_model_name

0 commit comments

Comments
 (0)