Skip to content

Commit

Permalink
use as_posix instead of str()
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Feb 18, 2022
1 parent 86fc2f4 commit dd93c33
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions zntrack/core/functions/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ def write_dvc_command(self, node_name: str) -> list:
continue
if isinstance(getattr(self, field), (list, tuple)):
for element in getattr(self, field):
script += [f"--{field.replace('_', '-')}", str(element)]
script += [
f"--{field.replace('_', '-')}",
pathlib.Path(element).as_posix(),
]
elif getattr(self, field) is not None:
script += [f"--{field.replace('_', '-')}", str(getattr(self, field))]
script += [
f"--{field.replace('_', '-')}",
pathlib.Path(getattr(self, field)).as_posix(),
]

return script

Expand Down

0 comments on commit dd93c33

Please sign in to comment.