cog/Scripts/genversion.sh

18 lines
554 B
Bash
Raw Normal View History

#!/bin/sh
git_version=$(/usr/bin/git describe --tags | sed -e 's/k54-//')
2020-03-01 23:09:30 +00:00
short_version=${git_version%-*}
build_time=$(date)
echo "git_version=${git_version}"
2020-03-01 23:09:30 +00:00
echo "short_version=${short_version}"
2013-10-13 00:53:59 +00:00
echo "build_time=${build_time}"
info_plist="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion '${git_version}'" "${info_plist}"
2020-03-01 23:09:30 +00:00
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString '${short_version}'" "${info_plist}"
/usr/libexec/PlistBuddy -c "Add :BuildTime date '${build_time}'" "${info_plist}"
2013-10-13 00:53:59 +00:00
exit 0