From 6579e54c2be818c45cfc390187146e55e7cd21aa Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 31 Mar 2021 12:02:51 +0200 Subject: [PATCH] Improved windows support --- src/cpl_cli/configuration/build_settings.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/cpl_cli/configuration/build_settings.py b/src/cpl_cli/configuration/build_settings.py index 8c9e34c0..f24be025 100644 --- a/src/cpl_cli/configuration/build_settings.py +++ b/src/cpl_cli/configuration/build_settings.py @@ -1,3 +1,4 @@ +import sys import traceback from typing import Optional @@ -70,6 +71,25 @@ class BuildSettings(ConfigurationModelABC): self._included = settings[BuildSettingsNameEnum.included.value] self._excluded = settings[BuildSettingsNameEnum.excluded.value] self._package_data = settings[BuildSettingsNameEnum.package_data.value] + + if sys.platform == 'win32': + self._source_path = str(self._source_path).replace('/', '\\') + self._output_path = str(self._output_path).replace('/', '\\') + + # windows paths for excluded files + excluded = [] + for ex in self._excluded: + excluded.append(str(ex).replace('/', '\\')) + + self._excluded = excluded + + # windows paths for included files + included = [] + for inc in self._included: + included.append(str(inc).replace('/', '\\')) + + self._included = included + except Exception as e: Console.set_foreground_color(ForegroundColorEnum.red) Console.write_line(