From 8f4b770905284bfbde929cbce02e4fa45adbffb7 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 18 Aug 2023 10:43:04 +0200 Subject: [PATCH] check asset paths before opening tar file --- qgispluginci/release.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qgispluginci/release.py b/qgispluginci/release.py index 23f08492..1ac6f93b 100644 --- a/qgispluginci/release.py +++ b/qgispluginci/release.py @@ -229,9 +229,10 @@ def create_archive( # https://stackoverflow.com/a/48462950/1548052 tt.add(file) # Add assets - with tarfile.open(top_tar_file, mode="a") as tt: - for asset_path in asset_paths: - tt.add(asset_path) + if len(asset_paths) > 0: + with tarfile.open(top_tar_file, mode="a") as tt: + for asset_path in asset_paths: + tt.add(asset_path) # converting to ZIP # why using TAR before? because it provides the prefix and makes things easier