mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Update checkLabels.sh
This commit is contained in:
@@ -98,19 +98,32 @@ BLUE='\033[1;34m'
|
|||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
# Has label(s) been given as arguments or not, and list those
|
# Has label(s) been given as arguments or not, and list those
|
||||||
# Figure out which ones of these include "${arch}" so those will be testet for both architectures
|
# Figure out which ones of these include "$(arch)" so those will be testet for both i386 and arm64 architectures
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
allLabels=( $(grep -h -E '^([a-z0-9\_-]*)(\)|\|\\)$' ${labels_dir}/*.sh | tr -d ')|\\' | sort) )
|
allLabels=( $(grep -h -E '^([a-z0-9\_-]*)(\)|\|\\)$' ${labels_dir}/*.sh | tr -d ')|\\' | sort) )
|
||||||
archLabels=( $(grep "\$(arch)" ${labels_dir}/* | awk '{print $1}' | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g'| uniq ) )
|
archLabels=( $(grep "\$(arch)" ${labels_dir}/* | awk '{print $1}' | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g'| uniq ) )
|
||||||
else
|
else
|
||||||
allLabels=( ${=@} )
|
allLabels=( ${=@} )
|
||||||
# Next line needs to be improved to only look through the labels given as arguments
|
# Check if labels exist
|
||||||
archLabels=( $(grep "\$(arch)" ${labels_dir}/* | awk '{print $1}' | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g'| uniq ) )
|
for checkLabel in $allLabels; do
|
||||||
|
if [ ! $(ls ${labels_dir}/${checkLabel}.sh 2>/dev/null) ] ; then
|
||||||
|
# Remove label from array
|
||||||
|
allLabels=("${(@)allLabels:#$checkLabel}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Figure out if labels has "$(arch)" in them
|
||||||
|
archLabels=( $allLabels )
|
||||||
|
for checkLabel in $archLabels; do
|
||||||
|
if [ ! -n "$(grep "\$(arch)" ${labels_dir}/${checkLabel}.sh 2>/dev/null)" ] ; then
|
||||||
|
# Remove label from array
|
||||||
|
archLabels=("${(@)archLabels:#$checkLabel}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${BLUE}Total labels:${NC}\n${allLabels}\n"
|
echo "${BLUE}Total labels:${NC}\n${allLabels}\n"
|
||||||
echo "${BLUE}Labels with \"\$(arch)\" call:${NC}\n${archLabels}\n"
|
echo "${BLUE}Labels with \"\$(arch)\" call:${NC}\n${archLabels}\n"
|
||||||
|
|
||||||
|
|
||||||
secondRoundLabels="" # variable for labels with $(arch) call in them
|
secondRoundLabels="" # variable for labels with $(arch) call in them
|
||||||
countWarning=0
|
countWarning=0
|
||||||
countError=0
|
countError=0
|
||||||
|
|||||||
Reference in New Issue
Block a user