You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
608 B

SCRIPT_DIR=$(dirname "$0")
PROJECT_TO_GET_VERSION_FOR=$1
# Get Absolute Paths
pushd "${SCRIPT_DIR}" >/dev/null
SCRIPT_DIR=$(pwd)
popd >/dev/null
# Sanity Check
exitAndPrintHelp()
{
echo "Must be called passing \`PROJECT_TO_GET_VERSION_FOR\` (mandatory).\
The value must be one of the keys in _config/pEp_versions.plist"
exit 1
}
if [ "${PROJECT_TO_GET_VERSION_FOR}" = "" ]; then
exitAndPrintHelp
fi
# Go
PEP_VERSIONS_PLIST="${SCRIPT_DIR}/_config/pEp_versions.plist"
VERSION=$(/usr/libexec/PlistBuddy -c "Print ${PROJECT_TO_GET_VERSION_FOR}" "${PEP_VERSIONS_PLIST}")
echo ${VERSION}