peter-iakovlev / Telegram

Telegram Messenger for iOS
3.22k stars 858 forks source link

run telegram for first time #154

Open Mont4 opened 7 years ago

Mont4 commented 7 years ago

when i compile for first time

sh: /Users/imohammad/Developer/Projects/iSocial/Telegram/tools/bump_build_number.sh: No such file or directory sh: /Users/imohammad/Developer/Projects/iSocial/Telegram/tools/sync_watch_version.sh: No such file or directory

screen shot 2017-07-30 at 9 41 54 pm
molaeiali commented 7 years ago

same problem

velmurugansubramaniam2 commented 7 years ago

create "tools" and add following files from

Both files available in https://github.com/TinkoffCreditSystems/MoneyTalk/tree/master/tools Filename: "bump_build_number.sh"

#!/bin/sh

#########
#
# This script will increment the build number of the project by one on project
# build, but only if the project has changed since last increment
#
# Add this as a Run Script in XCode. You will need to make sure that this script
# is located in a /xcode-bump-build-number directory in your project root folder.
#
# ${PROJECT_DIR}/xcode-bump-build-number/bump_build_number.sh ${INFOPLIST_FILE}
#
#########

if [ $# -ne 1 ]; then
    echo usage: $0 plist-file
    exit 1
fi

plist="$1"
dir="$(dirname "$plist")"

# Only increment the build number if source files have changed
if [ -n "$(find "$dir" \! -path "*xcuserdata*" \! -path "*.git" -newer "$plist")" ]; then
    buildnum=$(/usr/libexec/Plistbuddy -c "Print CFBundleVersion" "$plist")
    if [ -z "$buildnum" ]; then
        echo "No build number in $plist"
        exit 2
    fi
    buildnum=$(expr $buildnum + 1)
    /usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "$plist"
    echo "Incremented build number to $buildnum"
else
    echo "Not incrementing build number as source files have not changed"
fi

File: "sync_watch_version.sh"

#!/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"