From 2e8b1dc96ca84fce539151d0457edb2034e92f7c Mon Sep 17 00:00:00 2001 From: Bridgehead User Date: Fri, 12 Jul 2024 08:45:17 +0200 Subject: [PATCH] Deal with multiple data files The original TransFAIR logic was only able to handle a single CSV file and broke if there were more. This commit fixes that. --- lib/functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/functions.sh b/lib/functions.sh index b4a8c9b..10d7c31 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -282,9 +282,9 @@ function build_transfair() { # We only take the touble to build transfair if: # - # 1. There is no data lock file (which means that no ETL has yet been run) and - # 2. There is data available. - if [ -f ../ecdc/data/*.[cC][sS][vV] ] && [ ! -f ../ecdc/data/lock ]; then + # 1. There is data available (any CSV files) and + # 2. There is no data lock file (which means that no ETL has yet been run). + if ls ../ecdc/data/*.[cC][sS][vV] 1> /dev/null 2>&1 && [ ! -f ../ecdc/data/lock ]; then cd $base_dir/transfair docker build --progress=plain -t samply/transfair --no-cache . cd -