2014-07-09 03:49:20 +00:00
|
|
|
#!/bin/bash
|
2014-07-09 06:39:44 +00:00
|
|
|
|
2014-07-09 03:49:20 +00:00
|
|
|
MY_PATH="`dirname \"$0\"`"
|
2014-07-09 06:39:44 +00:00
|
|
|
if [ -f "$MY_PATH/build_number" ]
|
2014-07-09 03:49:20 +00:00
|
|
|
then
|
2014-07-09 06:39:44 +00:00
|
|
|
number=`cat $MY_PATH/build_number`
|
|
|
|
else
|
|
|
|
number=0
|
|
|
|
fi
|
|
|
|
|
2014-07-10 04:53:37 +00:00
|
|
|
if [ ! -f $MY_PATH/../build_number.h ]
|
|
|
|
then
|
|
|
|
# This is needed to build, so make sure it's available
|
|
|
|
echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$MY_PATH/ReleaseManager" ]
|
|
|
|
then
|
|
|
|
# Script only needs running by Release Managers
|
|
|
|
exit;
|
|
|
|
fi
|
|
|
|
|
2014-07-09 06:54:50 +00:00
|
|
|
if [ "$1" == "release" ]
|
2014-07-09 06:39:44 +00:00
|
|
|
then
|
|
|
|
echo "Updating build number"
|
|
|
|
let number++
|
|
|
|
echo "$number" > $MY_PATH/build_number
|
|
|
|
echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h
|
|
|
|
else
|
2014-07-09 03:49:20 +00:00
|
|
|
echo "Skipping build number update"
|
|
|
|
fi
|