From df319b8f92beaa540a0dfeda8f8f3b331537bca3 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 4 Jul 2021 12:43:38 -0400 Subject: [PATCH 1/2] Add argument for dev mode to build script --- build.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) mode change 100644 => 100755 build.py diff --git a/build.py b/build.py old mode 100644 new mode 100755 index 1fc528d7..1b4082da --- a/build.py +++ b/build.py @@ -63,7 +63,7 @@ def create_addon_xml(config: dict, source: str, py_version: str) -> None: tree.write('{}/addon.xml'.format(source), encoding='utf-8', xml_declaration=True) -def zip_files(py_version: str, source: str, target: str) -> None: +def zip_files(py_version: str, source: str, target: str, dev: bool) -> None: """ Create installable addon zip archive """ @@ -73,7 +73,7 @@ def zip_files(py_version: str, source: str, target: str) -> None: for root, dirs, files in os.walk(args.source): for filename in filter(file_filter, files): file_path = os.path.join(root, filename) - if folder_filter(file_path): + if folder_filter(file_path) or dev: relative_path = os.path.join('plugin.video.jellyfin', os.path.relpath(file_path, source)) z.write(file_path, relative_path) @@ -113,6 +113,9 @@ if __name__ == '__main__': type=Path, default=Path(__file__).absolute().parent) + parser.add_argument('--dev', dest='dev', action='store_true') + parser.set_defaults(dev=False) + args = parser.parse_args() # Load config file @@ -122,4 +125,4 @@ if __name__ == '__main__': create_addon_xml(release_config, args.source, args.version) - zip_files(args.version, args.source, args.target) + zip_files(args.version, args.source, args.target, args.dev) From 3d37b3a7437dae77d9ad5e89b799cf3177a8e168 Mon Sep 17 00:00:00 2001 From: mcarlton00 Date: Sun, 4 Jul 2021 21:02:46 -0400 Subject: [PATCH 2/2] Change order of if statement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Odd Stråbø --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 1b4082da..7d73f092 100755 --- a/build.py +++ b/build.py @@ -73,7 +73,7 @@ def zip_files(py_version: str, source: str, target: str, dev: bool) -> None: for root, dirs, files in os.walk(args.source): for filename in filter(file_filter, files): file_path = os.path.join(root, filename) - if folder_filter(file_path) or dev: + if dev or folder_filter(file_path): relative_path = os.path.join('plugin.video.jellyfin', os.path.relpath(file_path, source)) z.write(file_path, relative_path)