From 3bbf98b9b458faaf4ca8c48e2b0c172fd3ee168b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 20 Dec 2020 15:20:32 +0100 Subject: [PATCH] Improved publisher --- src/sh_edraft/publishing/publisher.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sh_edraft/publishing/publisher.py b/src/sh_edraft/publishing/publisher.py index 9a9a1518..4a8bf1cd 100644 --- a/src/sh_edraft/publishing/publisher.py +++ b/src/sh_edraft/publishing/publisher.py @@ -64,14 +64,20 @@ class Publisher(PublisherBase): for r, d, f in os.walk(included): for file in f: + rel_path = os.path.relpath(r) + if not rel_path.startswith('.'): + rel_path = f'./{rel_path}' + file_path = os.path.join(self._publish_settings.source_path, r, file) if os.path.isfile(file_path): self._included_files.append(file_path) + elif os.path.isfile(os.path.join(rel_path, file)): + self._included_files.append(os.path.join(rel_path, file)) else: self._logger.fatal(__name__, f'File not found: {file}') elif os.path.isfile(included): - self._included_files.append(os.path.join(self._publish_settings.source_path, included)) + self._included_files.append(included) else: self._logger.fatal(__name__, f'File not found: {included}')