Now reads labels from first line of label files

Instead of reading the name of the file
This commit is contained in:
Søren Theilgaard
2021-08-26 16:14:51 +02:00
parent c37229d763
commit d167a51ee6

View File

@@ -98,7 +98,7 @@ archLabels=( $(grep "\$(arch)" ${pathToLabels}/* | awk '{print $1}' | sed -E 's/
echo "${BLUE}Labels with \"\$(arch)\" call:${NC}\n${archLabels}\n"
if [[ $# -eq 0 ]]; then
allLabels=( $(ls ${pathToLabels}/*.sh | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g') )
allLabels=( $(grep -h -E '^([a-z0-9\_-]*)(\)|\|\\)$' ${pathToLabels}/*.sh | tr -d ')|\\' | sort) )
else
allLabels=( ${=@} )
fi