Filter file list as well

This commit is contained in:
ac
2023-12-31 10:14:19 +10:00
parent 29a7560940
commit e421d658e3

View File

@@ -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]
get_dirs_filt:
- !reference [.commands, get_files]
- |
FILTERED=$(echo "")
for d in $DIRS
FILT_FILES=""
FILT_DIRS=""
for f in $FILES
do
if [[ "$d" =~ ^[0-9]{4}-.*$ ]]
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