1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 17:38:07 +01:00
Telegram/tools/sync_watch_version.sh

28 lines
626 B
Bash
Raw Normal View History

2015-10-01 18:19:52 +02:00
#!/bin/sh
if [ $# -ne 2 ]; then
echo usage: $0 app-plist-file watch-plist-file
exit 1
fi
plist="$1"
watchplist="$2"
dir="$(dirname "$plist")"
version=$(/usr/libexec/Plistbuddy -c "Print CFBundleShortVersionString" "$plist")
if [ -z "$version" ]; then
echo "No version number in $plist"
exit 2
fi
buildnum=$(/usr/libexec/Plistbuddy -c "Print CFBundleVersion" "$plist")
if [ -z "$buildnum" ]; then
echo "No build number in $plist"
exit 2
fi
/usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $version" "$watchplist"
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "$watchplist"