diff --git a/utils/increment_build_number.sh b/utils/increment_build_number.sh index e9f78c08..c309f973 100644 --- a/utils/increment_build_number.sh +++ b/utils/increment_build_number.sh @@ -3,12 +3,11 @@ curr_path=${BASH_SOURCE%/*} version_file_path=../src/version.h.in pushd $curr_path + +# clear old local changes if any +git checkout -- src/* + git pull --ff-only -if [ $? -ne 0 ]; then - echo "Failed to pull" - popd - exit $? -fi build_no_before=`cat $version_file_path | grep 'PROJECT_VERSION_BUILD_NO ' | awk {'print $3'}` @@ -19,15 +18,11 @@ build_no_after=`cat $version_file_path | grep 'PROJECT_VERSION_BUILD_NO ' | awk echo "$build_no_before -> $build_no_after" echo $(pwd -P) + git status git commit -a -m"=== build number: $build_no_before -> $build_no_after ===" git push -if [ $? -ne 0 ]; then - echo "Failed to push" - popd - exit $? -fi echo "Build number was succesefully incremented." popd