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:
@@ -14,13 +14,16 @@
|
||||
|
||||
|
||||
# MARK: Constants
|
||||
SELF=$(basename $0)
|
||||
SELFLOCATION=$(dirname $0)
|
||||
pathToLabels=../"fragments/labels"
|
||||
pathToLabels="fragments/labels"
|
||||
|
||||
#echo "Script: $SELFLOCATION/$SELF\n"
|
||||
if [[ ! -d ${pathToLabels} ]]; then
|
||||
echo "This script should be called from Installomator directory as working directory with this command:"
|
||||
echo "utils/checkLabels.sh"
|
||||
echo
|
||||
exit 99
|
||||
fi
|
||||
|
||||
# MARK: check minimal macOS requirement
|
||||
# MARK: Check minimal macOS requirement
|
||||
if [[ $(sw_vers -buildVersion ) < "18" ]]; then
|
||||
echo "Installomator requires at least macOS 10.14 Mojave."
|
||||
exit 98
|
||||
@@ -77,7 +80,7 @@ xpath() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Handling architecture, so I can verify both architectures
|
||||
# Handling architecture, so I can verify both i386 and arm64 architectures
|
||||
arch () {
|
||||
echo $fixedArch
|
||||
}
|
||||
@@ -91,11 +94,11 @@ BLUE='\033[1;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Labels with the $(arch) call for different versions for Intel and Apple Silicon should be listed here:
|
||||
archLabels=( $(grep "\$(arch)" "${pathToLabels}"/* | awk '{print $1}' | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g'| uniq ) )
|
||||
archLabels=( $(grep "\$(arch)" ${pathToLabels}/* | awk '{print $1}' | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g'| uniq ) )
|
||||
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=( $(ls ${pathToLabels}/*.sh | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g') )
|
||||
else
|
||||
allLabels=( ${=@} )
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user