From e421d658e3afc878dcbf64047daecde6aacb7429 Mon Sep 17 00:00:00 2001 From: ac Date: Sun, 31 Dec 2023 10:14:19 +1000 Subject: [PATCH] Filter file list as well --- kibot-ci.yml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/kibot-ci.yml b/kibot-ci.yml index 26578e1..5d23cc4 100644 --- a/kibot-ci.yml +++ b/kibot-ci.yml @@ -36,7 +36,7 @@ image: get_files: - FILES=$(find . -name *$SEARCH -not -path "./.gitlab/*") get_dirs: - - FILES=$(find . -name *$SEARCH -not -path "./.gitlab/*") + - !reference [.commands, get_files] - | if [[ $FILES == "" ]]; then DIRS="" @@ -46,19 +46,28 @@ image: sch_from_pro: - 'SCHEMS=$(for f in $FILES ; do echo "${f%.*}.kicad_sch"; done)' - 'SCHEMS=$(for f in $SCHEMS ; do echo "${f##**/}"; done)' - dir_arr: - - !reference [.commands, get_dirs] - - | - FILTERED=$(echo "") - for d in $DIRS - do - if [[ "$d" =~ ^[0-9]{4}-.*$ ]] + get_dirs_filt: + - !reference [.commands, get_files] + - | + FILT_FILES="" + FILT_DIRS="" + for f in $FILES + do + dir=$(dirname $f) + echo $dir + if [[ "$dir" =~ ^.?\/?[0-9]{4}-.*$ ]] then - FILTERED=$(echo "$FILTERED $d") + FILT_FILES=$(echo "$FILT_FILES $f") + FILT_DIRS=$(echo "$FILT_DIRS $dir") fi done - END=$(echo $FILTERED | wc -w) - dir_arr=($FILTERED) + FILES=$FILT_FILES + DIRS=$FILT_DIRS + dir_arr: + - !reference [.commands, get_dirs_filt] + - | + END=$(echo $DIRS | wc -w) + dir_arr=($DIRS) kibot: - 'SEARCH=".kicad_pro"' - !reference [.commands, dir_arr] @@ -101,7 +110,7 @@ image: neo: - 'SEARCH=".kicad_pro"' - - !reference [.commands, get_dirs] + - !reference [.commands, get_dirs_filt] - | for d in $DIRS do