Skip to content

Commit f02be6f

Browse files
committed
[OMCProcessWSL] define work directory for WSL
1 parent a63bd50 commit f02be6f

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
@@ -1281,12 +1281,14 @@ def __init__(
12811281
# connect to the running omc instance using ZMQ
12821282
self._omc_port = self._omc_port_get()
12831283

1284-
def _wsl_cmd(self) -> list[str]: # get wsl base command
1284+
def _wsl_cmd(self, wsl_cwd: Optional[str] = None) -> list[str]: # get wsl base command
12851285
wsl_cmd = ['wsl']
12861286
if isinstance(self._wsl_distribution, str):
12871287
wsl_cmd += ['--distribution', self._wsl_distribution]
12881288
if isinstance(self._wsl_user, str):
12891289
wsl_cmd += ['--user', self._wsl_user]
1290+
if isinstance(wsl_cwd, str):
1291+
wsl_cmd += ['--cd', wsl_cwd]
12901292
wsl_cmd += ['--']
12911293

12921294
return wsl_cmd
@@ -1345,7 +1347,7 @@ def omc_run_data_update(self, omc_run_data: OMCSessionRunData, session: OMCSessi
13451347
"""
13461348
omc_run_data_copy = dataclasses.replace(omc_run_data)
13471349

1348-
omc_run_data_copy.cmd_prefix = self._wsl_cmd()
1350+
omc_run_data_copy.cmd_prefix = self._wsl_cmd(wsl_cwd=omc_run_data.cmd_path)
13491351

13501352
cmd_path = session.omcpath(omc_run_data_copy.cmd_path)
13511353
cmd_model_executable = cmd_path / omc_run_data_copy.cmd_model_name

0 commit comments

Comments
 (0)