From c3282a05d6f676f21d40747d282ee9cc6e8c7a86 Mon Sep 17 00:00:00 2001 From: Patrick McClurg Date: Wed, 8 Nov 2023 16:56:40 +0100 Subject: [PATCH] added a graceful exit when there are no draws to complete --- recipients_selection/draw.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipients_selection/draw.sh b/recipients_selection/draw.sh index 20c48182c..c3c5b2010 100755 --- a/recipients_selection/draw.sh +++ b/recipients_selection/draw.sh @@ -13,6 +13,11 @@ $(cd ./draws && find . -type f | sort > "$draw_file") # we compare the contents to find files that exist as lists but not as draws remaining_draw_filenames=$(comm -3 "$list_file" "$draw_file" | awk '{print $1}') +if [ -z "$remaining_draw_filenames" ]; then + echo "no draws to execute" + exit 0 +fi + # we then actually run the draw while IFS= read -r filename; do # first we strip any leading ./