From 88c0153ca2a71f315d564cb31e1a43038e549ac5 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 31 Mar 2021 11:55:46 +0200 Subject: [PATCH] Improved windows support for publisher --- src/cpl_cli/publish/publisher_service.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cpl_cli/publish/publisher_service.py b/src/cpl_cli/publish/publisher_service.py index 0c1bc1ef..95f8e0cc 100644 --- a/src/cpl_cli/publish/publisher_service.py +++ b/src/cpl_cli/publish/publisher_service.py @@ -39,9 +39,11 @@ class PublisherService(PublisherABC): self._included_dirs: list[str] = [] self._distributed_files: list[str] = [] - self._src_path_part = 'src/' + self._path_mark = '/' if sys.platform == 'win32': - self._src_path_part = 'src\\' + self._path_mark = '\\' + + self._src_path_part = f'src{self._path_mark}' @property def source_path(self) -> str: @@ -60,7 +62,7 @@ class PublisherService(PublisherABC): if self._src_path_part in file: file = file.replace(self._src_path_part, '', 1) - dirs = os.path.dirname(file).split('/') + dirs = os.path.dirname(file).split(self._path_mark) for d in dirs: if d.__contains__('.'): dirs.remove(d)