From 09eb3a41d68109a4e7c1b80ab8a9955f57beadea Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 16 Dec 2020 17:54:29 +0100 Subject: [PATCH] Improved publish process --- src/build.json | 1 + src/sh_edraft/publishing/publisher.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/build.json b/src/build.json index da1551cc..d2ca1def 100644 --- a/src/build.json +++ b/src/build.json @@ -51,6 +51,7 @@ } ], "IncludedFiles": [ + "./MANIFEST.in", "../LICENSE", "../README.md", "../requirements.txt", diff --git a/src/sh_edraft/publishing/publisher.py b/src/sh_edraft/publishing/publisher.py index d426ee5f..7bb9fa87 100644 --- a/src/sh_edraft/publishing/publisher.py +++ b/src/sh_edraft/publishing/publisher.py @@ -68,6 +68,11 @@ class Publisher(PublisherBase): 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)) + else: + self._logger.fatal(__name__, f'File not found: {included}') + for r, d, f in os.walk(self._publish_settings.source_path): for file in f: is_file_excluded = False @@ -207,7 +212,11 @@ class Publisher(PublisherBase): elif file.startswith('.'): output_file = file.replace('.', '', 1) - output_file = f'{dist_path}{output_file}' + if output_file.__contains__('..'): + output_file = os.path.join(dist_path, os.path.basename(file)) + else: + output_file = f'{dist_path}{output_file}' + output_path = os.path.dirname(output_file) try: