From f2cf7e349871e78fa5347949d7eda2f5a1c1a227 Mon Sep 17 00:00:00 2001 From: antux18 Date: Thu, 22 Aug 2024 18:37:44 +0200 Subject: [PATCH] Handling of the case where no artifact configuration files have been found, or they have all been blacklisted. --- workflow/utils.smk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workflow/utils.smk b/workflow/utils.smk index 052c4c7..9b71ab0 100644 --- a/workflow/utils.smk +++ b/workflow/utils.smk @@ -39,4 +39,8 @@ def get_blacklisted(blacklist_dir_path): def get_artifacts_to_build(artifacts_folder, blacklist_dir_path): blacklisted = get_blacklisted(blacklist_dir_path) all_artifacts = set([os.path.splitext(a)[0] for a in os.listdir(artifacts_folder) if not os.path.isdir(os.path.join(artifacts_folder, a))]) - return list(all_artifacts.difference(blacklisted)) + artifacts_to_build = list(all_artifacts.difference(blacklisted)) + if artifacts_to_build != []: + return list(all_artifacts.difference(blacklisted)) + else: + raise(Exception(f"There is no artifact to build! Either no artifact configuration files have been found, or they have all been blacklisted."))