Handling of the case where no artifact configuration files have been found, or they have all been blacklisted.

This commit is contained in:
antux18 2024-08-22 18:37:44 +02:00
parent b8212061fd
commit f2cf7e3498

View File

@ -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))])
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."))